Interface IOption<V>
-
- Type Parameters:
V
- The type of the value that this option holds
- All Known Implementing Classes:
AbstractOption
,BooleanOption
,IntegerOption
,MultiStringOption
,ShowWhitespaceCharactersOption
,StringOption
public interface IOption<V>
This interface represents entity that supports capability to work with preferences and with UI elements
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getPreferenceKey()
Getter for#preferenceKey
String
getPresentation()
V
getValue()
Returns current value held by this option.void
handleSelection(V value)
This method invoked when associated UI element has changed selection and the given value is now set to UI element So there is no need to update UI element but preference representation.void
restoreDefault()
Restores default value for this optionvoid
setControl(IUpdatableControl<V> control)
Associates this option with given controlvoid
setValue(V value)
Sets the value of this option to the given value.void
uploadValue()
Reads current value fromIPreferenceManager
and sets it withsetValue(Object)
or in any other way with followingsetValue(Object)
protocolvoid
writeSelf()
Writes it self to the preferences with givenIPreferenceManager
-
-
-
Method Detail
-
setValue
void setValue(V value)
Sets the value of this option to the given value. This shall update UI representation- Parameters:
value
- , cannot benull
-
getValue
V getValue()
Returns current value held by this option. This shall not be affected byhandleSelection(Object)
.- Returns:
- value held by this option, cannot be
null
-
getPreferenceKey
String getPreferenceKey()
Getter for#preferenceKey
- Returns:
#preferenceKey
, cannot benull
-
handleSelection
void handleSelection(V value)
This method invoked when associated UI element has changed selection and the given value is now set to UI element So there is no need to update UI element but preference representation. This method shall not write preferences right to the store as this changes can be canceled with no callback.- Parameters:
value
- the new value to be set, can benull
-
writeSelf
void writeSelf()
Writes it self to the preferences with givenIPreferenceManager
-
setControl
void setControl(IUpdatableControl<V> control)
Associates this option with given control- Parameters:
control
- The control associated with this option, can benull
-
getPresentation
String getPresentation()
- Returns:
- Description of this option
-
uploadValue
void uploadValue()
Reads current value fromIPreferenceManager
and sets it withsetValue(Object)
or in any other way with followingsetValue(Object)
protocol- See Also:
setValue(Object)
-
restoreDefault
void restoreDefault()
Restores default value for this option
-
-