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 Stringm_Displaythe display text.protected booleanm_Enabledwhether the value definition is enabled.protected Actorm_FlowContextthe flow context.protected Stringm_Helpthe help text.protected Stringm_Namethe 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 booleanaddToPanel(PropertiesParameterPanel panel)Adds the value to the panel.booleancanBeRestored()Returns whether this definition can be restored from a restoration file.protected booleancheck()Method for checking setup state.voiddefineOptions()Adds options to the internal list of options.StringdisplayTipText()Returns the tip text for this property.StringenabledTipText()Returns the tip text for this property.abstract StringgetDefaultValueAsString()Returns the default of the value as string.StringgetDisplay()Returns the display text for the value.booleangetEnabled()Returns whether the definition is to be used.ActorgetFlowContext()Returns the flow context, if any.StringgetHelp()Returns the help text for the value.StringgetName()Returns the name of the value.abstract PropertiesParameterPanel.PropertyTypegetType()Returns the type of the value.abstract StringheadlessInteraction()Prompts the user to enter a value in headless mode and returns it.StringhelpTipText()Returns the tip text for this property.StringnameTipText()Returns the tip text for this property.protected abstract booleanrequiresFlowContext()Returns whether flow context is required.abstract voidsetDefaultValueAsString(String value)Sets the default value as string.voidsetDisplay(String value)Sets the display text for the value.voidsetEnabled(boolean value)Sets whether the definition is to be used.voidsetFlowContext(Actor value)Sets the flow context.voidsetHelp(String value)Sets the help text for the value.voidsetName(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:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setFlowContext
public void setFlowContext(Actor value)
Sets the flow context.- Specified by:
setFlowContextin interfaceFlowContextHandler- Parameters:
value- the actor
-
getFlowContext
public Actor getFlowContext()
Returns the flow context, if any.- Specified by:
getFlowContextin 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
-
-