Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.preferences.IPreferenceStore Interface Reference
Inheritance diagram for de.fu_berlin.inf.dpp.preferences.IPreferenceStore:
de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter

List of all members.

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)

Detailed Description

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 !


Member Function Documentation

void de.fu_berlin.inf.dpp.preferences.IPreferenceStore.addPreferenceChangeListener ( IPreferenceChangeListener  listener)

Registers a preference change listener that will be notified after each setValue() call.

Parameters:
listenera 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.

Parameters:
nameof the named preference
Returns:
the current boolean value

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.

Parameters:
nameof the named preference
Returns:
the default boolean value

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.

Parameters:
nameof the named preference
Returns:
the default integer value

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.

Parameters:
nameof the named preference
Returns:
the default long value

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).

Parameters:
nameof the named preference
Returns:
the default String value

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.

Parameters:
nameof the named preference
Returns:
the current integer value

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.

Parameters:
nameof the named preference
Returns:
the current long value

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).

Parameters:
nameof the named preference
Returns:
the default String 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.removePreferenceChangeListener ( IPreferenceChangeListener  listener)

removes a preference change listener. It has no effect, if the listener is not registered.

Parameters:
listenerthe 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.

Parameters:
nameof the named preference
valuenew 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.

Parameters:
nameof the named preference
valuenew 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.

Parameters:
nameof the named preference
valuenew 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.

Parameters:
nameof the named preference
valuenew 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.

Parameters:
nameof the named preference
valuenew 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.

Parameters:
nameof the named preference
valuenew 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.

Parameters:
nameof the named preference
valuenew 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.

Parameters:
nameof the named preference
valuenew current value

Implemented in de.fu_berlin.inf.dpp.preferences.EclipsePreferenceStoreAdapter, and de.fu_berlin.inf.dpp.intellij.preferences.PropertiesComponentAdapter.

 All Classes Namespaces Files Functions Variables Enumerations