V
- the kind of value this preference storespublic interface Preference<V>
DefaultPreferenceModel
. A
preference is a wrapper around some kind of exchangeable value. The preference
tells how that value can be modified and offers some information for users
about the usage of the value.Modifier and Type | Method and Description |
---|---|
void |
addPreferenceListener(PreferenceListener<V> listener)
Adds a listener to this preference.
|
void |
doOperation(PreferenceOperation operation)
Executes the enabled operation
operation . |
String |
getDescription()
Gets a long human readable description of this preference.
|
String |
getLabel()
Gets a short human readable string that is used as name for this preference.
|
PreferenceOperation[] |
getOperations()
Gets a list of operations which can be executed by this preference.
|
Path |
getPath()
Gets the unique path of this resource.
|
Path |
getTypePath()
Gets the type of the value that this preferences uses.
|
V |
getValue()
Gets the value of this preference.
|
Object |
getValueInfo()
Information about how the value of this preference can be
modified.
|
boolean |
isEnabled(PreferenceOperation operation)
Tells whether
operation is enabled and thus doOperation(PreferenceOperation)
can be called. |
boolean |
isNatural()
Tells whether this preference is natural or artificial.
|
void |
read()
Uses an unknown source to reload this preference.
|
void |
removePreferenceListener(PreferenceListener<V> listener)
Removes a listener from this preference.
|
void |
setModel(PreferenceModel model)
Sets the model which is using this preference.
|
void |
setValue(V value)
Sets the value of this preference.
|
void |
write()
Stores the contents of this preference at the location where it will
be used.
|
void read()
Preference
should not change its value.void write()
boolean isEnabled(PreferenceOperation operation)
operation
is enabled and thus doOperation(PreferenceOperation)
can be called.operation
- some operation of getOperations()
true
if the operation can be executedPreferenceOperation[] getOperations()
void doOperation(PreferenceOperation operation)
operation
. This method should not
be called if operation
is disabled.operation
- the key of the operationvoid setModel(PreferenceModel model)
model
- the model, can be null
void addPreferenceListener(PreferenceListener<V> listener)
listener
- the new listenervoid removePreferenceListener(PreferenceListener<V> listener)
listener
- the listener to removeString getLabel()
String getDescription()
null
, may be formated
in HTMLObject getValueInfo()
PreferenceModel.getValueInfo(int)
.null
V getValue()
null
void setValue(V value)
value
- the value, might be null
(depends on the
editor used for this preference)boolean isNatural()
true
if natural, false
if artificialPreferenceModel.isNatural(int)
Path getTypePath()
Path
Path getPath()