org.eclipse.ocl.common.preferences
Interface PreferenceableOption.PreferenceableOption2<T>

All Superinterfaces:
PreferenceableOption<T>
All Known Implementing Classes:
BooleanPreference, ClassPreference, EnumerationPreference, Preference, StringPreference, VirtualDelegateMapping
Enclosing interface:
PreferenceableOption<T>

public static interface PreferenceableOption.PreferenceableOption2<T>
extends PreferenceableOption<T>

The extended PreferenceableOption identifies a configurable behavior suitable for use in a Preference or Property Page. The extended behavior supports access to the Eclipse preference and listening for changes in the Eclipse setting.

Since:
1.1

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.common.preferences.PreferenceableOption
PreferenceableOption.Listener, PreferenceableOption.PreferenceableOption2<T>
 
Method Summary
 void addListener(PreferenceableOption.Listener listener)
          Add a listener to be notified of changes.
 void fireChanged(java.lang.String key, java.lang.Object oldValue, java.lang.Object newValue)
          Call-back notification that the Eclipse preference identified by a key, has changed from oldValue to new Value.
 T getPreferredValue()
          Get the preferred value of this option.
 void removeListener(PreferenceableOption.Listener listener)
          Remove a listener to be notified of changes.
 
Methods inherited from interface org.eclipse.ocl.common.preferences.PreferenceableOption
getDefaultValue, getKey, getPluginId, getValueOf
 

Method Detail

addListener

void addListener(@NonNull
                 PreferenceableOption.Listener listener)
Add a listener to be notified of changes.

Parameters:
listener -

fireChanged

void fireChanged(@NonNull
                 java.lang.String key,
                 @Nullable
                 java.lang.Object oldValue,
                 @Nullable
                 java.lang.Object newValue)
Call-back notification that the Eclipse preference identified by a key, has changed from oldValue to new Value.

Parameters:
key -
oldValue -
newValue -

getPreferredValue

@Nullable
T getPreferredValue()
Get the preferred value of this option. When running standalone this is the built-in default. When running in Eclipse, the built-in default may be overridden by a user preference.


removeListener

void removeListener(@NonNull
                    PreferenceableOption.Listener listener)
Remove a listener to be notified of changes.

Parameters:
listener -