IPreferenceStore
interface represents a table mapping named preferences to values. If there is no value for a given name, then that preferences's default value is returned; and if there is no default value for that preference, then a default-default value is returned. The default-default values for the primitive types are as follows: boolean
= false
double
= 0.0
float
= 0.0f
int
= 0
long
= 0
String
= ""
(the empty string)Thus a preference store maintains two values for each of a set of names: a current value and a default value. The typical usage is to establish the defaults for all known preferences and then restore previously stored values for preferences whose values were different from their defaults. After the current values of the preferences have been modified, it is a simple matter to write out only those preferences whose values are different from their defaults. This two-tiered approach to saving and restoring preference setting minimized the number of preferences that need to be persisted; indeed, the normal starting state does not require storing any preferences at all.
A property change event is reported whenever a preferences current value actually changes (whether through setValue
, setToDefault
, or other unspecified means). Note, however, that manipulating default values (with setDefault
) does not cause such events to be reported.
Clients who need a preference store may implement this interface or instantiate the standard implementation PreferenceStore
.
IPreferenceStore
interface represents a table mapping named preferences to values. If there is no value for a given name, then that preferences's default value is returned; and if there is no default value for that preference, then a default-default value is returned. The default-default values for the primitive types are as follows: boolean
= false
double
= 0.0
float
= 0.0f
int
= 0
long
= 0
String
= ""
(the empty string)Thus a preference store maintains two values for each of a set of names: a current value and a default value. The typical usage is to establish the defaults for all known preferences and then restore previously stored values for preferences whose values were different from their defaults. After the current values of the preferences have been modified, it is a simple matter to write out only those preferences whose values are different from their defaults. This two-tiered approach to saving and restoring preference setting minimized the number of preferences that need to be persisted; indeed, the normal starting state does not require storing any preferences at all.
A property change event is reported whenever a preferences current value actually changes (whether through setValue
, setToDefault
, or other unspecified means). Note, however, that manipulating default values (with setDefault
) does not cause such events to be reported.
Clients who need a preference store may implement this interface or instantiate the standard implementation PreferenceStore
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|