public class ComboOption extends InputOption
Combo option
The user can choose option value from a list. By default, the property is set with the value of the list. Subclasses
may override this behavior (see getValue()
)
Constructor and Description |
---|
ComboOption(ILabel label,
String outputProperty,
String[] items)
Create an option based on a combo box.
|
ComboOption(ILabel label,
String outputProperty,
String[] items,
String[] realValues)
Create an option based on a combo box.
|
Modifier and Type | Method and Description |
---|---|
String |
getErrorMessage()
An option is considered to be valid if:
it is not enabled it has no validator it has a validator which returns without errors |
String |
getSelection()
Return null if no item selected
|
int |
getSelectionIndex(String propertyValue)
Called when initializing the option.
|
String |
getValue()
Get the current value of the option
By default, returns the currently selected item message
Subclasses may override this method to return an other value (converted from currently selected index for example)
|
void |
setInitialValue(int initialValueIndex) |
addOptionChangedListener, getConfigurationAttributeName, getOutputProperty, getProperty, setOptionValidator
isEnabled, setDescription, setEnableCondition
public ComboOption(ILabel label, String outputProperty, String[] items)
items
- should not be emptypublic String getErrorMessage()
InputOption
getErrorMessage
in class InputOption
null
if the option is valid.public String getSelection()
public int getSelectionIndex(String propertyValue)
propertyValue
- may be null if the value has never been registered (most likely a new launch)getValue()
public String getValue()
public void setInitialValue(int initialValueIndex)