public class PackagePropertiesModel
extends java.lang.Object
| Constructor and Description |
|---|
PackagePropertiesModel(org.eclipse.core.resources.IFile pFile)
Create a new package.properties model for a given file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBasicLibrary(org.eclipse.core.resources.IFolder pLibFolder)
Adds a Basic library folder to the package.
|
void |
addChangeListener(IModelChangedListener pListener)
Add a listener notified of the model changes.
|
void |
addContent(org.eclipse.core.resources.IResource pRes)
Adds a file or directory to the package properties.
|
void |
addDescriptionFile(org.eclipse.core.resources.IFile pDescription,
java.util.Locale pLocale)
Adds a localized package description file.
|
void |
addDialogLibrary(org.eclipse.core.resources.IFolder pLibFolder)
Adds a basic dialog library folder to the package.
|
void |
clearBasicLibraries()
Removes all the basic libraries from the package properties.
|
void |
clearContents()
Removes all the file and directories from the package properties that has been added using
addContent(IResource). |
void |
clearDescriptions()
Removes all the description files from the package properties.
|
void |
clearDialogLibraries()
Removes all the dialog libraries from the package properties.
|
void |
firePackageChanged()
Notify that the package properties model has changed.
|
void |
firePackageSaved()
Notify that the package properties model has been saved.
|
java.util.List<org.eclipse.core.resources.IFolder> |
getBasicLibraries() |
java.util.List<org.eclipse.core.resources.IResource> |
getContents() |
java.util.Map<java.util.Locale,org.eclipse.core.resources.IFile> |
getDescriptionFiles() |
java.util.List<org.eclipse.core.resources.IFolder> |
getDialogLibraries() |
boolean |
isDirty() |
void |
reloadFromString(java.lang.String pContent)
Clears all the content of the package properties and replace it by a string as if it would have been the
properties file content.
|
void |
removeChangedListener(IModelChangedListener pListener)
Removes a class listening the model changes.
|
void |
setQuiet(boolean pQuiet)
Set whether the changes should be notified to the listeners or not.
|
void |
write()
Writes the Package properties to the file.
|
java.lang.String |
writeToString() |
public PackagePropertiesModel(org.eclipse.core.resources.IFile pFile)
throws java.lang.IllegalArgumentException
pFile - the package.properties file represented by the object.java.lang.IllegalArgumentException - if the file is nullpublic void setQuiet(boolean pQuiet)
pQuiet - true if the changes should be notified, false otherwise.public void addChangeListener(IModelChangedListener pListener)
pListener - the listener to add.public void removeChangedListener(IModelChangedListener pListener)
pListener - the listener to removepublic void firePackageSaved()
public void firePackageChanged()
public boolean isDirty()
true if the properties model has changed but isn't saved, false otherwise.public void write()
throws java.lang.Exception
java.lang.Exception - if the data can't be writtenpublic void reloadFromString(java.lang.String pContent)
pContent - the string describing the datapublic java.lang.String writeToString()
public void addBasicLibrary(org.eclipse.core.resources.IFolder pLibFolder)
throws java.lang.IllegalArgumentException
pLibFolder - the library folder to addjava.lang.IllegalArgumentException - is thrown if the argument is nullpublic void addDialogLibrary(org.eclipse.core.resources.IFolder pLibFolder)
throws java.lang.IllegalArgumentException
pLibFolder - the library folder to addjava.lang.IllegalArgumentException - is thrown if the argument is nullpublic java.util.List<org.eclipse.core.resources.IFolder> getDialogLibraries()
public java.util.List<org.eclipse.core.resources.IFolder> getBasicLibraries()
public void clearBasicLibraries()
public void clearDialogLibraries()
public void addContent(org.eclipse.core.resources.IResource pRes)
throws java.lang.IllegalArgumentException
Do not add dialog or basic libraries or package descriptions using this method: use the appropriate method.
pRes - the resource to addjava.lang.IllegalArgumentException - is thrown if the argument is nullpublic java.util.List<org.eclipse.core.resources.IResource> getContents()
public void clearContents()
addContent(IResource).public void addDescriptionFile(org.eclipse.core.resources.IFile pDescription,
java.util.Locale pLocale)
throws java.lang.IllegalArgumentException
null.pDescription - the description filepLocale - the file locale.java.lang.IllegalArgumentException - is thrown if the file is null or doesn't exists or if the locale is null.public java.util.Map<java.util.Locale,org.eclipse.core.resources.IFile> getDescriptionFiles()
public void clearDescriptions()