T
- the type of the option's valuepublic abstract class Preference<T> extends Object implements PreferenceableOption.PreferenceableOption2<T>
BooleanPreference
,
ClassPreference
,
EnumerationPreference
PreferenceableOption.Listener, PreferenceableOption.PreferenceableOption2<T>
Modifier and Type | Field and Description |
---|---|
T |
defaultValue |
String |
key |
String |
pluginId |
Constructor and Description |
---|
Preference(String pluginId,
String key,
T defaultValue) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(PreferenceableOption.Listener listener)
Add a listener to be notified of changes.
|
void |
fireChanged(String key,
Object oldValue,
Object newValue)
Call-back notification that the Eclipse preference identified by a key, has changed from
oldValue to new Value.
|
T |
getDefaultValue()
Obtains the option's default value.
|
String |
getKey()
Obtains my string key, which may be used for persistence in a
preference store.
|
String |
getPluginId()
Returns the plugin qualifier for the key.
|
T |
getPreferredValue()
Get the preferred value of this option.
|
void |
removeListener(PreferenceableOption.Listener listener)
Remove a listener to be notified of changes.
|
void |
setDefaultValue(T defaultValue) |
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getValueOf
public final String pluginId
public final String key
public T defaultValue
public void addListener(PreferenceableOption.Listener listener)
PreferenceableOption.PreferenceableOption2
addListener
in interface PreferenceableOption.PreferenceableOption2<T>
public void fireChanged(String key, Object oldValue, Object newValue)
PreferenceableOption.PreferenceableOption2
fireChanged
in interface PreferenceableOption.PreferenceableOption2<T>
public String getKey()
getKey
in interface PreferenceableOption<T>
null
public String getPluginId()
PreferenceableOption
getPluginId
in interface PreferenceableOption<T>
public T getDefaultValue()
getDefaultValue
in interface PreferenceableOption<T>
null
public T getPreferredValue()
getPreferredValue
in interface PreferenceableOption.PreferenceableOption2<T>
public void removeListener(PreferenceableOption.Listener listener)
PreferenceableOption.PreferenceableOption2
removeListener
in interface PreferenceableOption.PreferenceableOption2<T>
public void setDefaultValue(T defaultValue)
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.