org.openoffice.ide.eclipse.core.model.description
Class DescriptionModel

java.lang.Object
  extended by org.openoffice.ide.eclipse.core.model.description.DescriptionModel
All Implemented Interfaces:
IModel

public class DescriptionModel
extends java.lang.Object
implements IModel

Class representing the description.xml file.

Author:
Cédric Bosdonnat

Constructor Summary
DescriptionModel()
          Default constructor.
 
Method Summary
 void addDescription(java.util.Locale pLocale, java.lang.String pValue)
          Add or update a description.
 void addDisplayName(java.util.Locale pLocale, java.lang.String pValue)
          Add or update a display name.
 void addLicense(java.util.Locale pLocale, java.lang.String pValue)
          Add or update a license.
 void addListener(IModelChangedListener pListener)
          Add a model listener.
 void addPublisherInfo(java.util.Locale pLocale, PublisherInfos pValue)
          Add or update a publisherInfo.
 void addReleaseNote(java.util.Locale pLocale, java.lang.String pValue)
          Add or update a release note.
 void addUpdateInfo(java.lang.String pValue)
          Add or update a updateInfos.
protected  void fireModelChanged()
          Tells everyone that the model has changed.
protected  void fireModelSaved()
          Tells everyone that the model has been saved.
 java.util.ArrayList<java.util.Locale> getAllLocales()
           
 java.lang.String getDefaultIcon()
           
 java.util.HashMap<java.util.Locale,java.lang.String> getDescriptions()
           
 java.util.HashMap<java.util.Locale,java.lang.String> getDisplayNames()
           
 java.lang.String getHCIcon()
           
 java.lang.String getId()
           
 java.util.HashMap<java.util.Locale,java.lang.String> getLicenses()
           
 java.lang.String getMaxOOo()
           
 java.lang.String getMinOOo()
           
 java.lang.String getPlatforms()
           
 java.util.HashMap<java.util.Locale,PublisherInfos> getPublisherInfos()
           
 java.util.HashMap<java.util.Locale,java.lang.String> getReleaseNotes()
           
 java.util.ArrayList<java.lang.String> getUpdateInfos()
           
 java.lang.String getVersion()
           
 boolean isAcceptByUser()
           
 boolean isDirty()
          
 boolean isSuppressOnUpdate()
           
 void removeDescription(java.util.Locale pLocale)
          Remove a description.
 void removeDisplayName(java.util.Locale pLocale)
          Remove a display name.
 void removeLicense(java.util.Locale pLocale)
          Remove a license.
 void removeListener(IModelChangedListener pListener)
          Remove a model listener.
 void removePublisherInfo(java.util.Locale pLocale)
          Remove a publisherInfo.
 void removeReleaseNote(java.util.Locale pLocale)
          Remove a release note.
 void removeUpdateInfo(java.lang.String pValue)
          Remove a updateInfos.
 void replaceUpdateInfo(int pIndex, java.lang.String pValue)
          Replace an existing update info.
 void serialize(java.io.OutputStream pOut)
          Serializes the data in XML to an output stream.
 void setAcceptByUser(boolean pAcceptByUser)
           
 void setDefaultIcon(java.lang.String pDefaultIcon)
           
 void setHCIcon(java.lang.String pHCIcon)
           
 void setId(java.lang.String pId)
           
 void setMaxOOo(java.lang.String pMaxOOo)
           
 void setMinOOo(java.lang.String pMinOOo)
           
 void setPlatforms(java.lang.String pPlatforms)
           
 void setSuppressOnUpdate(boolean pSuppressOnUpdate)
           
 void setSuspendEvent(boolean pSuspend)
          
 void setVersion(java.lang.String pVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescriptionModel

public DescriptionModel()
Default constructor.

Method Detail

addListener

public void addListener(IModelChangedListener pListener)
Add a model listener.

Specified by:
addListener in interface IModel
Parameters:
pListener - the listener to add

removeListener

public void removeListener(IModelChangedListener pListener)
Remove a model listener.

Specified by:
removeListener in interface IModel
Parameters:
pListener - the listener to remove

isDirty

public boolean isDirty()

Specified by:
isDirty in interface IModel
Returns:
whether the model has been changed without being saved or not.

setSuspendEvent

public void setSuspendEvent(boolean pSuspend)

Specified by:
setSuspendEvent in interface IModel
Parameters:
pSuspend - true to suspend the events for the model

getAllLocales

public java.util.ArrayList<java.util.Locale> getAllLocales()
Returns:
all the locales defined in the different parts of the model.

getId

public java.lang.String getId()
Returns:
the id

setId

public void setId(java.lang.String pId)
Parameters:
pId - the id to set

getVersion

public java.lang.String getVersion()
Returns:
the version

setVersion

public void setVersion(java.lang.String pVersion)
Parameters:
pVersion - the version to set

getDisplayNames

public java.util.HashMap<java.util.Locale,java.lang.String> getDisplayNames()
Returns:
the displayNames

addDisplayName

public void addDisplayName(java.util.Locale pLocale,
                           java.lang.String pValue)
Add or update a display name.

Parameters:
pLocale - the locale for the display name to add / update
pValue - the value to add / update.

removeDisplayName

public void removeDisplayName(java.util.Locale pLocale)
Remove a display name.

Parameters:
pLocale - the locale of the display name to remove

getMinOOo

public java.lang.String getMinOOo()
Returns:
the minOOo

setMinOOo

public void setMinOOo(java.lang.String pMinOOo)
Parameters:
pMinOOo - the minOOo to set

getMaxOOo

public java.lang.String getMaxOOo()
Returns:
the maxOOo

setMaxOOo

public void setMaxOOo(java.lang.String pMaxOOo)
Parameters:
pMaxOOo - the maxOOo to set

getPlatforms

public java.lang.String getPlatforms()
Returns:
the platforms

setPlatforms

public void setPlatforms(java.lang.String pPlatforms)
Parameters:
pPlatforms - the platforms to set

getDefaultIcon

public java.lang.String getDefaultIcon()
Returns:
the defaultIcon

setDefaultIcon

public void setDefaultIcon(java.lang.String pDefaultIcon)
Parameters:
pDefaultIcon - the defaultIcon to set

getHCIcon

public java.lang.String getHCIcon()
Returns:
the hCIcon

setHCIcon

public void setHCIcon(java.lang.String pHCIcon)
Parameters:
pHCIcon - the hCIcon to set

getDescriptions

public java.util.HashMap<java.util.Locale,java.lang.String> getDescriptions()
Returns:
the descriptions

addDescription

public void addDescription(java.util.Locale pLocale,
                           java.lang.String pValue)
Add or update a description.

Parameters:
pLocale - the locale for the description to add / update
pValue - the value to add / update.

removeDescription

public void removeDescription(java.util.Locale pLocale)
Remove a description.

Parameters:
pLocale - the locale of the description to remove

getReleaseNotes

public java.util.HashMap<java.util.Locale,java.lang.String> getReleaseNotes()
Returns:
the releaseNotes

addReleaseNote

public void addReleaseNote(java.util.Locale pLocale,
                           java.lang.String pValue)
Add or update a release note.

Parameters:
pLocale - the locale for the release note to add / update
pValue - the value to add / update.

removeReleaseNote

public void removeReleaseNote(java.util.Locale pLocale)
Remove a release note.

Parameters:
pLocale - the locale of the release note to remove

getUpdateInfos

public java.util.ArrayList<java.lang.String> getUpdateInfos()
Returns:
the updateInfos

addUpdateInfo

public void addUpdateInfo(java.lang.String pValue)
Add or update a updateInfos.

Parameters:
pValue - the value to add / update.

replaceUpdateInfo

public void replaceUpdateInfo(int pIndex,
                              java.lang.String pValue)
Replace an existing update info.

Parameters:
pIndex - the index to change
pValue - the new value

removeUpdateInfo

public void removeUpdateInfo(java.lang.String pValue)
Remove a updateInfos.

Parameters:
pValue - the value to remove

isAcceptByUser

public boolean isAcceptByUser()
Returns:
the acceptByUser

setAcceptByUser

public void setAcceptByUser(boolean pAcceptByUser)
Parameters:
pAcceptByUser - the acceptByUser to set

isSuppressOnUpdate

public boolean isSuppressOnUpdate()
Returns:
the suppressOnUpdate

setSuppressOnUpdate

public void setSuppressOnUpdate(boolean pSuppressOnUpdate)
Parameters:
pSuppressOnUpdate - the suppressOnUpdate to set

getLicenses

public java.util.HashMap<java.util.Locale,java.lang.String> getLicenses()
Returns:
the licenses

addLicense

public void addLicense(java.util.Locale pLocale,
                       java.lang.String pValue)
Add or update a license.

Parameters:
pLocale - the locale for the license to add / update
pValue - the value to add / update.

removeLicense

public void removeLicense(java.util.Locale pLocale)
Remove a license.

Parameters:
pLocale - the locale of the license to remove

getPublisherInfos

public java.util.HashMap<java.util.Locale,PublisherInfos> getPublisherInfos()
Returns:
the publisherInfos

addPublisherInfo

public void addPublisherInfo(java.util.Locale pLocale,
                             PublisherInfos pValue)
Add or update a publisherInfo.

Parameters:
pLocale - the locale for the publisherInfo to add / update
pValue - the value to add / update.

removePublisherInfo

public void removePublisherInfo(java.util.Locale pLocale)
Remove a publisherInfo.

Parameters:
pLocale - the locale of the publisherInfo to remove

serialize

public void serialize(java.io.OutputStream pOut)
Serializes the data in XML to an output stream.

Parameters:
pOut - the output stream where to write the data

fireModelChanged

protected void fireModelChanged()
Tells everyone that the model has changed.


fireModelSaved

protected void fireModelSaved()
Tells everyone that the model has been saved.