Class ListSelectionValueDefinition
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.valuedefinition.AbstractValueDefinition
-
- adams.flow.source.valuedefinition.ListSelectionValueDefinition
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,FlowContextHandler
,Serializable
public class ListSelectionValueDefinition extends AbstractValueDefinition
Specialized definition for lists, allowing to define a default value.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
EnterManyValues
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_DefaultValue
the default value.protected boolean
m_MultiSelect
whether to use multi-select.protected BaseString[]
m_Values
the list values to choose from.-
Fields inherited from class adams.flow.source.valuedefinition.AbstractValueDefinition
m_Display, m_Enabled, m_FlowContext, m_Help, m_Name
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ListSelectionValueDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addToPanel(PropertiesParameterPanel panel)
Adds the value to the panel.String
defaultValueTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.String
getDefaultValue()
Returns the default list value.String
getDefaultValueAsString()
Returns the default of the value as string.PropertiesParameterPanel.PropertyType
getType()
Returns the type of the value.BaseString[]
getValues()
Returns the available list items to choose from.String
globalInfo()
Returns a string describing the object.String
headlessInteraction()
Prompts the user to enter a value in headless mode and returns it.boolean
isMultiSelect()
Returns whether multiple options can be selected.String
multiSelectTipText()
Returns the tip text for this property.protected boolean
requiresFlowContext()
Returns whether flow context is required.void
setDefaultValue(String value)
Sets the default list value.void
setDefaultValueAsString(String value)
Sets the default value as string.void
setMultiSelect(boolean value)
Sets whether to allow selection of multiple options.void
setValues(BaseString[] value)
Sets the available list items to choose from.String
valuesTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.source.valuedefinition.AbstractValueDefinition
canBeRestored, check, displayTipText, enabledTipText, getDisplay, getEnabled, getFlowContext, getHelp, getName, helpTipText, nameTipText, setDisplay, setEnabled, setFlowContext, setHelp, setName
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Values
protected BaseString[] m_Values
the list values to choose from.
-
m_DefaultValue
protected String m_DefaultValue
the default value.
-
m_MultiSelect
protected boolean m_MultiSelect
whether to use multi-select.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractValueDefinition
-
setValues
public void setValues(BaseString[] value)
Sets the available list items to choose from.- Parameters:
value
- the items
-
getValues
public BaseString[] getValues()
Returns the available list items to choose from.- Returns:
- the items
-
valuesTipText
public String valuesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDefaultValue
public void setDefaultValue(String value)
Sets the default list value.- Parameters:
value
- the default
-
getDefaultValue
public String getDefaultValue()
Returns the default list value.- Returns:
- the default
-
defaultValueTipText
public String defaultValueTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMultiSelect
public void setMultiSelect(boolean value)
Sets whether to allow selection of multiple options.- Parameters:
value
- true if multi-select enabled
-
isMultiSelect
public boolean isMultiSelect()
Returns whether multiple options can be selected.- Returns:
- true if multi-select enabled
-
multiSelectTipText
public String multiSelectTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getType
public PropertiesParameterPanel.PropertyType getType()
Returns the type of the value.- Specified by:
getType
in classAbstractValueDefinition
- Returns:
- the type
-
setDefaultValueAsString
public void setDefaultValueAsString(String value)
Sets the default value as string.- Specified by:
setDefaultValueAsString
in classAbstractValueDefinition
- Parameters:
value
- the default value
-
getDefaultValueAsString
public String getDefaultValueAsString()
Returns the default of the value as string.- Specified by:
getDefaultValueAsString
in classAbstractValueDefinition
- Returns:
- the default
-
requiresFlowContext
protected boolean requiresFlowContext()
Returns whether flow context is required.- Specified by:
requiresFlowContext
in classAbstractValueDefinition
- Returns:
- true if required
-
addToPanel
public boolean addToPanel(PropertiesParameterPanel panel)
Adds the value to the panel.- Specified by:
addToPanel
in classAbstractValueDefinition
- Parameters:
panel
- the panel to add to- Returns:
- true if successfully added
-
headlessInteraction
public String headlessInteraction()
Prompts the user to enter a value in headless mode and returns it.- Specified by:
headlessInteraction
in classAbstractValueDefinition
- Returns:
- the entered value, null if canceled
-
-