Class AbstractValueDefinition
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.valuedefinition.AbstractValueDefinition
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,FlowContextHandler
,Serializable
- Direct Known Subclasses:
AbstractArrayValueDefinition
,AbstractGOEValueDefinition
,DefaultValueDefinition
,DirectoryValueDefinition
,EnumValueDefinition
,FileValueDefinition
,ListSelectionValueDefinition
,RegExpConstrainedStringDefinition
public abstract class AbstractValueDefinition extends AbstractOptionHandler implements FlowContextHandler
Combines name, type and default value for a single 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_Display
the display text.protected boolean
m_Enabled
whether the value definition is enabled.protected Actor
m_FlowContext
the flow context.protected String
m_Help
the help text.protected String
m_Name
the name of the value.-
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 AbstractValueDefinition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
addToPanel(PropertiesParameterPanel panel)
Adds the value to the panel.boolean
canBeRestored()
Returns whether this definition can be restored from a restoration file.protected boolean
check()
Method for checking setup state.void
defineOptions()
Adds options to the internal list of options.String
displayTipText()
Returns the tip text for this property.String
enabledTipText()
Returns the tip text for this property.abstract String
getDefaultValueAsString()
Returns the default of the value as string.String
getDisplay()
Returns the display text for the value.boolean
getEnabled()
Returns whether the definition is to be used.Actor
getFlowContext()
Returns the flow context, if any.String
getHelp()
Returns the help text for the value.String
getName()
Returns the name of the value.abstract PropertiesParameterPanel.PropertyType
getType()
Returns the type of the value.abstract String
headlessInteraction()
Prompts the user to enter a value in headless mode and returns it.String
helpTipText()
Returns the tip text for this property.String
nameTipText()
Returns the tip text for this property.protected abstract boolean
requiresFlowContext()
Returns whether flow context is required.abstract void
setDefaultValueAsString(String value)
Sets the default value as string.void
setDisplay(String value)
Sets the display text for the value.void
setEnabled(boolean value)
Sets whether the definition is to be used.void
setFlowContext(Actor value)
Sets the flow context.void
setHelp(String value)
Sets the help text for the value.void
setName(String value)
Sets the name of the value.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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_Enabled
protected boolean m_Enabled
whether the value definition is enabled.
-
m_Name
protected String m_Name
the name of the value.
-
m_Display
protected String m_Display
the display text.
-
m_Help
protected String m_Help
the help text.
-
m_FlowContext
protected Actor m_FlowContext
the flow context.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setFlowContext
public void setFlowContext(Actor value)
Sets the flow context.- Specified by:
setFlowContext
in interfaceFlowContextHandler
- Parameters:
value
- the actor
-
getFlowContext
public Actor getFlowContext()
Returns the flow context, if any.- Specified by:
getFlowContext
in interfaceFlowContextHandler
- Returns:
- the actor, null if none available
-
requiresFlowContext
protected abstract boolean requiresFlowContext()
Returns whether flow context is required.- Returns:
- true if required
-
setEnabled
public void setEnabled(boolean value)
Sets whether the definition is to be used.- Parameters:
value
- true if enabled
-
getEnabled
public boolean getEnabled()
Returns whether the definition is to be used.- Returns:
- true if enabled
-
enabledTipText
public String enabledTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setName
public void setName(String value)
Sets the name of the value.- Parameters:
value
- the name
-
getName
public String getName()
Returns the name of the value.- Returns:
- the name
-
nameTipText
public String nameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDisplay
public void setDisplay(String value)
Sets the display text for the value.- Parameters:
value
- the display text
-
getDisplay
public String getDisplay()
Returns the display text for the value.- Returns:
- the display text
-
displayTipText
public String displayTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHelp
public void setHelp(String value)
Sets the help text for the value.- Parameters:
value
- the help text
-
getHelp
public String getHelp()
Returns the help text for the value.- Returns:
- the help text
-
helpTipText
public String helpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
protected boolean check()
Method for checking setup state.- Returns:
- true if checks successful
-
getType
public abstract PropertiesParameterPanel.PropertyType getType()
Returns the type of the value.- Returns:
- the type
-
setDefaultValueAsString
public abstract void setDefaultValueAsString(String value)
Sets the default value as string.- Parameters:
value
- the default value
-
getDefaultValueAsString
public abstract String getDefaultValueAsString()
Returns the default of the value as string.- Returns:
- the default
-
addToPanel
public abstract boolean addToPanel(PropertiesParameterPanel panel)
Adds the value to the panel.- Parameters:
panel
- the panel to add to- Returns:
- true if successfully added
-
headlessInteraction
public abstract String headlessInteraction()
Prompts the user to enter a value in headless mode and returns it.- Returns:
- the entered value, null if canceled
-
canBeRestored
public boolean canBeRestored()
Returns whether this definition can be restored from a restoration file.- Returns:
- true if can be restored
-
-