Class MultiStringOption
- java.lang.Object
-
- com.e1c.g5.v8.dt.formatter.ui.preferences.option.AbstractOption<String>
-
- com.e1c.g5.v8.dt.formatter.ui.preferences.option.StringOption
-
- com.e1c.g5.v8.dt.formatter.ui.preferences.option.MultiStringOption
-
public class MultiStringOption extends StringOption
This class represents a chose-one option
-
-
Field Summary
-
Fields inherited from class com.e1c.g5.v8.dt.formatter.ui.preferences.option.StringOption
manager, store
-
Fields inherited from class com.e1c.g5.v8.dt.formatter.ui.preferences.option.AbstractOption
control, value
-
-
Constructor Summary
Constructors Constructor Description MultiStringOption(String preferenceKey, String presentation, IPreferenceManager manager, org.eclipse.jface.preference.IPreferenceStore store, String[] options, String[] optionPresentations)
Creates new instance of chose-one option with given preference key, preference manager and array of options to chose from
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCurentChoisePresentation()
Returns presentation of current valueString[]
getOptions()
Returns options that can be chosenString[]
getOptionsPresentations()
ReturnsoptionsAndPresentations
keys as arrayvoid
handleSelection(String 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
setValue(String value)
Sets the value of this option to the given value.-
Methods inherited from class com.e1c.g5.v8.dt.formatter.ui.preferences.option.StringOption
restoreDefault, uploadValue, writeSelf
-
Methods inherited from class com.e1c.g5.v8.dt.formatter.ui.preferences.option.AbstractOption
getPreferenceKey, getPresentation, getValue, setControl, setUploaded
-
-
-
-
Constructor Detail
-
MultiStringOption
public MultiStringOption(String preferenceKey, String presentation, IPreferenceManager manager, org.eclipse.jface.preference.IPreferenceStore store, String[] options, String[] optionPresentations)
Creates new instance of chose-one option with given preference key, preference manager and array of options to chose from- Parameters:
preferenceKey
- The associated to this option preference key, cannot benull
manager
- The manager that stores this option, cannot benull
presentation
- The options presentation that describes its aim, cannot benull
options
- The options to chose from, cannot benull
optionPresentations
- The options values presentation, cannot benull
-
-
Method Detail
-
getOptions
public String[] getOptions()
Returns options that can be chosen- Returns:
- Options that can be chosen, cannot be
null
-
getOptionsPresentations
public String[] getOptionsPresentations()
ReturnsoptionsAndPresentations
keys as array- Returns:
- Presentations to options
-
getCurentChoisePresentation
public String getCurentChoisePresentation()
Returns presentation of current value- Returns:
- The string that is presentation of current value, cannot be
null
-
handleSelection
public void handleSelection(String value)
Description copied from interface:IOption
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.- Specified by:
handleSelection
in interfaceIOption<String>
- Overrides:
handleSelection
in classAbstractOption<String>
- Parameters:
value
- the new value to be set, can benull
-
-