|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bigzip.Settings
A individual Settings object is passed to each plugin. A plugin can use this object to store information that needs to be user preferences for the plugin. The Settings object will be serialized/deserialized between BiGZiP sessions.
A plugin can also create a hierarchy of settings using the createChild and getChild methods. Each child is given an id which is used to access the child. Several Settings objects may have a child with the same id but that id refers to different instances of the Settings object. Because each plugin receives its own Settings object, there is not need for concern about name conflicts between the installed plugins.
A plugin can provide a settings customizer to allow the user to customize its settings. A plugin uses the setSettingsCustomizer to associate a customizer with the Settings object. The settings customizer is responsible for providing the user with access to customize any child Settings objects.
Constructor Summary | |
Settings()
|
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers a PropertyChangeListener with this Settings object. |
Settings |
createChild(java.lang.String childID)
Creates a child Settings object under this settings object in the settings hierarchy. |
void |
deleteAllChildren()
Deletes all the child Settings objects under this Settings object. |
void |
deleteChild(java.lang.String childID)
Deletes the child with the specified id from this Settings object. |
Settings |
getChild(java.lang.String childID)
Returns the settings object for this child with the given id. |
SettingsCustomizer |
getCustomizer()
Returns the settings customizer UI component that the preferences dialog box can display to allow the user to customize this settings object. |
java.lang.String |
getSetting(java.lang.String settingName)
Retrieve the setting with the given name from this Settings object. |
java.lang.String |
getSetting(java.lang.String name,
java.lang.String defaultValue)
Retrieve the setting with the given name from this Settings object. |
boolean |
getSettingAsBoolean(java.lang.String name,
boolean defaultValue)
Retrieves a boolean setting with the given name from this Settings object. |
byte |
getSettingAsByte(java.lang.String name,
byte defaultValue)
Retrieves a byte-sized setting with the given name from this Settings object. |
char |
getSettingAsCharacter(java.lang.String name,
char defaultValue)
Retrieves a char-sized setting with the given name from this Settings object. |
double |
getSettingAsDouble(java.lang.String name,
double defaultValue)
Retrieves a double-sized setting with the given name from this Settings object. |
float |
getSettingAsFloat(java.lang.String name,
float defaultValue)
Retrieves a float-sized setting with the given name from this Settings object. |
int |
getSettingAsInt(java.lang.String name,
int defaultValue)
Retrieves an int-sized setting with the given name from this Settings object. |
long |
getSettingAsLong(java.lang.String name,
long defaultValue)
Retrieves a long-sized setting with the given name from this Settings object. |
short |
getSettingAsShort(java.lang.String name,
short defaultValue)
Retrieves a short-sized setting with the given name from this Settings object. |
boolean |
hasChild(java.lang.String childID)
Tests if a child with the given childId exists in this Settings object. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters a listener from this Settings object. |
void |
setCustomizer(SettingsCustomizer customizer)
Associate a settings customizer with this Settings obeject. |
void |
setSetting(java.lang.String settingName,
java.lang.String settingValue)
Sets a setting with the given name in this Settings object. |
void |
setSettingAsBoolean(java.lang.String name,
boolean value)
Sets a boolean-sized setting with the given name in this Settings object. |
void |
setSettingAsByte(java.lang.String name,
byte value)
Sets a byte-sized setting with the given name in this Settings object. |
void |
setSettingAsCharacter(java.lang.String name,
char value)
Sets a char-sized setting with the given name in this Settings object. |
void |
setSettingAsDouble(java.lang.String name,
double value)
Sets a double-sized setting with the given name in this Settings object. |
void |
setSettingAsFloat(java.lang.String name,
float value)
Sets a float-sized setting with the given name in this Settings object. |
void |
setSettingAsInt(java.lang.String name,
int value)
Sets an int-sized setting with the given name in this Settings object. |
void |
setSettingAsLong(java.lang.String name,
long value)
Sets a long-sized setting with the given name in this Settings object. |
void |
setSettingAsShort(java.lang.String name,
short value)
Sets a short-sized setting with the given name in this Settings object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Settings()
Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to be registered.public Settings createChild(java.lang.String childID)
Normally, one would use the getChild method which will automatically create a new child if it doesn't exist.
childID
- The id for the new child which can be used in the future
to access it.public void deleteAllChildren()
public void deleteChild(java.lang.String childID)
public Settings getChild(java.lang.String childID)
childID
- The id for the child.public SettingsCustomizer getCustomizer()
public java.lang.String getSetting(java.lang.String settingName)
settingName
- The name of the setting to retreive.public java.lang.String getSetting(java.lang.String name, java.lang.String defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public boolean getSettingAsBoolean(java.lang.String name, boolean defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public byte getSettingAsByte(java.lang.String name, byte defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public char getSettingAsCharacter(java.lang.String name, char defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public double getSettingAsDouble(java.lang.String name, double defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public float getSettingAsFloat(java.lang.String name, float defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public int getSettingAsInt(java.lang.String name, int defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public long getSettingAsLong(java.lang.String name, long defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public short getSettingAsShort(java.lang.String name, short defaultValue)
name
- The name of the setting to retreive.defaultValue
- The value to return if the settings doesn't exists.public void setSettingAsBoolean(java.lang.String name, boolean value)
name
- The name of the setting to retreive.value
- The new value of the setting.public void setSettingAsByte(java.lang.String name, byte value)
name
- The name of the setting to retreive.value
- The new value of the setting.public void setSettingAsCharacter(java.lang.String name, char value)
name
- The name of the setting to retreive.value
- The new value of the setting.public void setSettingAsDouble(java.lang.String name, double value)
name
- The name of the setting to retreive.value
- The new value of the setting.public void setSettingAsFloat(java.lang.String name, float value)
name
- The name of the setting to retreive.value
- The new value of the setting.public void setSettingAsInt(java.lang.String name, int value)
name
- The name of the setting to retreive.value
- The new value of the setting.public void setSettingAsLong(java.lang.String name, long value)
name
- The name of the setting to retreive.value
- The new value of the setting.public void setSettingAsShort(java.lang.String name, short value)
name
- The name of the setting to retreive.value
- The new value of the setting.public boolean hasChild(java.lang.String childID)
childID
- The id of the child.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listsner
- The listener to unregister.public void setCustomizer(SettingsCustomizer customizer)
public void setSetting(java.lang.String settingName, java.lang.String settingValue)
settingName
- The name of the setting to be set.settingValue
- The new value of the setting.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |