Class DirectoryValueDefinition
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.valuedefinition.AbstractValueDefinition
-
- adams.flow.source.valuedefinition.DirectoryValueDefinition
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,AbsolutePathSupporter
,ForwardSlashSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,FlowContextHandler
,Serializable
public class DirectoryValueDefinition extends AbstractValueDefinition implements ForwardSlashSupporter, AbsolutePathSupporter
Value definition specifically for directories.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PlaceholderDirectory
m_DefaultValue
the default directory.protected String
m_FileChooserTitle
the title of the file chooser dialog.protected boolean
m_UseAbsolutePath
whether to use absolute path rather than placeholders.protected boolean
m_UseForwardSlashes
whether to output forward slashes.-
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 DirectoryValueDefinition()
-
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
fileChooserTitleTipText()
Returns the tip text for this property.PlaceholderDirectory
getDefaultValue()
Returns the default of the value.String
getDefaultValueAsString()
Returns the default of the value as string.String
getFileChooserTitle()
Returns the title for the file chooser dialog.PropertiesParameterPanel.PropertyType
getType()
Returns the type of the value.boolean
getUseAbsolutePath()
Returns whether to use absolute paths.boolean
getUseForwardSlashes()
Returns whether to use forward slashes in the output.String
globalInfo()
Returns a string describing the object.String
headlessInteraction()
Prompts the user to enter a value in headless mode and returns it.protected boolean
requiresFlowContext()
Returns whether flow context is required.void
setDefaultValue(PlaceholderDirectory value)
Sets the default of the value.void
setDefaultValueAsString(String value)
Sets the default value as string.void
setFileChooserTitle(String value)
Sets the title for the file chooser dialog.void
setUseAbsolutePath(boolean value)
Sets whether to use absolute paths.void
setUseForwardSlashes(boolean value)
Sets whether to use forward slashes in the output.String
useAbsolutePathTipText()
Returns the tip text for this property.String
useForwardSlashesTipText()
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_FileChooserTitle
protected String m_FileChooserTitle
the title of the file chooser dialog.
-
m_DefaultValue
protected PlaceholderDirectory m_DefaultValue
the default directory.
-
m_UseForwardSlashes
protected boolean m_UseForwardSlashes
whether to output forward slashes.
-
m_UseAbsolutePath
protected boolean m_UseAbsolutePath
whether to use absolute path rather than placeholders.
-
-
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
-
setFileChooserTitle
public void setFileChooserTitle(String value)
Sets the title for the file chooser dialog.- Parameters:
value
- the title
-
getFileChooserTitle
public String getFileChooserTitle()
Returns the title for the file chooser dialog.- Returns:
- the title
-
fileChooserTitleTipText
public String fileChooserTitleTipText()
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(PlaceholderDirectory value)
Sets the default of the value.- Parameters:
value
- the default
-
getDefaultValue
public PlaceholderDirectory getDefaultValue()
Returns the default of the 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.
-
setUseForwardSlashes
public void setUseForwardSlashes(boolean value)
Sets whether to use forward slashes in the output.- Specified by:
setUseForwardSlashes
in interfaceForwardSlashSupporter
- Parameters:
value
- if true then use forward slashes
-
getUseForwardSlashes
public boolean getUseForwardSlashes()
Returns whether to use forward slashes in the output.- Specified by:
getUseForwardSlashes
in interfaceForwardSlashSupporter
- Returns:
- true if forward slashes are used
-
useForwardSlashesTipText
public String useForwardSlashesTipText()
Returns the tip text for this property.- Specified by:
useForwardSlashesTipText
in interfaceForwardSlashSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseAbsolutePath
public void setUseAbsolutePath(boolean value)
Sets whether to use absolute paths.- Specified by:
setUseAbsolutePath
in interfaceAbsolutePathSupporter
- Parameters:
value
- if true if absolute paths
-
getUseAbsolutePath
public boolean getUseAbsolutePath()
Returns whether to use absolute paths.- Specified by:
getUseAbsolutePath
in interfaceAbsolutePathSupporter
- Returns:
- true if absolute paths
-
useAbsolutePathTipText
public String useAbsolutePathTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
requiresFlowContext
protected boolean requiresFlowContext()
Returns whether flow context is required.- Specified by:
requiresFlowContext
in classAbstractValueDefinition
- Returns:
- true if required
-
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
-
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
-
-