Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Public Member Functions | |
void | addPreferenceChangeListener (IPreferenceChangeListener listener) |
void | removePreferenceChangeListener (IPreferenceChangeListener listener) |
boolean | getBoolean (String name) |
boolean | getDefaultBoolean (String name) |
int | getInt (String name) |
int | getDefaultInt (String name) |
long | getLong (String name) |
long | getDefaultLong (String name) |
String | getString (String name) |
String | getDefaultString (String name) |
void | setValue (String name, int value) |
void | setDefault (String name, int value) |
void | setValue (String name, long value) |
void | setDefault (String name, long value) |
void | setValue (String name, String value) |
void | setDefault (String name, String value) |
void | setValue (String name, boolean value) |
void | setDefault (String name, boolean value) |
Implementations of IPreferences store key-value pairs and notify listeners upon value changes.
There is a default value and a current value for each preference. If there is no current value, the default value will be returned. If there is no default value for the type indicated by the method's name will be returned.
boolean
= false
double
= 0.0
float
= 0.0f
int
= 0
long
= 0
String
= ""
(the empty string) This default-default values will also be returned when the given preference cannot be converted into this required type.
The typical life-cycle starts with setting the default values and then goes on with setting the preferences that differ from the defaults.
After the current value was changed through setValue()
, all registered IPreferenceChangeListener listeners} will be notified.
Note: It is up to the implementation to persist default values and so clients should not rely on those default values until they are (re)set !
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.addPreferenceChangeListener | ( | IPreferenceChangeListener | listener | ) |
Registers a preference change listener that will be notified after each setValue() call.
listener | a preference change listener |
Implemented in de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
boolean de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getBoolean | ( | String | name | ) |
Returns the current value of the named preference as a Boolean. If there is no preference or the value can not be converted to a boolean, it returns false
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
boolean de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getDefaultBoolean | ( | String | name | ) |
Returns the default value of the named preference as a Boolean. If there is no preference or the value can not be converted to a boolean, it returns false
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
int de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getDefaultInt | ( | String | name | ) |
Returns the default value of the named preference as a Integer. If there is no preference or the value can not be converted to a integer, it returns 0
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
long de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getDefaultLong | ( | String | name | ) |
Returns the default value of the named preference as a Long. If there is no preference or the value can not be converted to a long, it returns 0
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
String de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getDefaultString | ( | String | name | ) |
Returns the default value of the named preference as a String. If there is no preference or the value can not be converted to a String, it returns ""(empty String)
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
int de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getInt | ( | String | name | ) |
Returns the current value of the named preference as a Integer. If there is no preference or the value can not be converted to a integer, it returns 0
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
long de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getLong | ( | String | name | ) |
Returns the current value of the named preference as a Long. If there is no preference or the value can not be converted to a long, it returns 0
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
String de.fu_berlin.inf.dpp.preferences.IPreferenceStore.getString | ( | String | name | ) |
Returns the current value of the named preference as a String. If there is no preference or the value can not be converted to a String, it returns ""(empty String)
.
name | of the named preference |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.removePreferenceChangeListener | ( | IPreferenceChangeListener | listener | ) |
removes a preference change listener. It has no effect, if the listener is not registered.
listener | the listener must not be null |
Implemented in de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setDefault | ( | String | name, |
long | value | ||
) |
Sets the current default value to an Long valued preference for the given name. No preferenceChangeEvent will be reported.
name | of the named preference |
value | new default value |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setDefault | ( | String | name, |
int | value | ||
) |
Sets the current default value to an Integer valued preference for the given name. No preferenceChangeEvent will be reported.
name | of the named preference |
value | new current value |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setDefault | ( | String | name, |
String | value | ||
) |
Sets the current default value to an String valued preference for the given name. No preferenceChangeEvent will be reported.
name | of the named preference |
value | new default value, can not be null |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setDefault | ( | String | name, |
boolean | value | ||
) |
Sets the current default value to an Boolean valued preference for the given name. No preferenceChangeEvent will be reported.
name | of the named preference |
value | new default value |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setValue | ( | String | name, |
String | value | ||
) |
Sets the current value to an String valued preference for the given name. If the new value differ from the old value, a preferenceChangeEvent will be reported.
name | of the named preference |
value | new current value, can not be null |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setValue | ( | String | name, |
int | value | ||
) |
Sets the current value to an Integer valued preference for the given name. If the new value differ from the old value, a preferenceChangeEvent will be reported.
name | of the named preference |
value | new current value |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setValue | ( | String | name, |
long | value | ||
) |
Sets the current value to an Long valued preference for the given name. If the new value differ from the old value, a preferenceChangeEvent will be reported.
name | of the named preference |
value | new default value |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.
void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.setValue | ( | String | name, |
boolean | value | ||
) |
Sets the current value to an Boolean valued preference for the given name. If the new value differ from the old value, a preferenceChangeEvent will be reported.
name | of the named preference |
value | new current value |
Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.