V - the kind of value this preference usespublic abstract class AbstractPreference<V> extends Object implements Preference<V>
Preference that offers support
for PreferenceListeners.| Constructor and Description |
|---|
AbstractPreference() |
| 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. |
protected void |
fireChanged()
Informs all listeners that the value of this preference has changed.
|
PreferenceOperation[] |
getOperations()
Gets a list of operations which can be executed by this preference.
|
protected boolean |
hasListeners()
Tells whether this preference currently has listeners.
|
boolean |
isEnabled(PreferenceOperation operation)
Tells whether
operation is enabled and thus Preference.doOperation(PreferenceOperation)
can be called. |
protected PreferenceListener<V>[] |
listeners()
Gets all the listeners of this preference.
|
void |
removePreferenceListener(PreferenceListener<V> listener)
Removes a listener from this preference.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDescription, getLabel, getPath, getTypePath, getValue, getValueInfo, isNatural, read, setModel, setValue, writepublic void addPreferenceListener(PreferenceListener<V> listener)
PreferenceaddPreferenceListener in interface Preference<V>listener - the new listenerpublic void removePreferenceListener(PreferenceListener<V> listener)
PreferenceremovePreferenceListener in interface Preference<V>listener - the listener to removeprotected boolean hasListeners()
true if there are any listenersprotected PreferenceListener<V>[] listeners()
protected void fireChanged()
public boolean isEnabled(PreferenceOperation operation)
Preferenceoperation is enabled and thus Preference.doOperation(PreferenceOperation)
can be called.isEnabled in interface Preference<V>operation - some operation of Preference.getOperations()true if the operation can be executedpublic PreferenceOperation[] getOperations()
PreferencegetOperations in interface Preference<V>public void doOperation(PreferenceOperation operation)
Preferenceoperation. This method should not
be called if operation is disabled.doOperation in interface Preference<V>operation - the key of the operationCopyright © 2017 Docking Frames. All rights reserved.