Class FileValueDefinition
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.valuedefinition.AbstractValueDefinition
-
- adams.flow.source.valuedefinition.FileValueDefinition
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,AbsolutePathSupporter,ForwardSlashSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,FlowContextHandler,Serializable
public class FileValueDefinition extends AbstractValueDefinition implements ForwardSlashSupporter, AbsolutePathSupporter
Value definition specifically for files.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_AcceptAllFileFilterwhether to allow the "All files" filter.protected PlaceholderFilem_DefaultValuethe default file.protected BaseString[]m_Extensionsthe extensions to offer in the file chooser.protected Stringm_FileChooserTitlethe title of the file chooser dialog.protected PlaceholderDirectorym_InitialDirectorythe initial directory.protected booleanm_MultiSelectwhether to select multiple files.protected booleanm_UseAbsolutePathwhether to use absolute path rather than placeholders.protected booleanm_UseForwardSlasheswhether 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 FileValueDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringacceptAllFileFilterTipText()Returns the tip text for this property.booleanaddToPanel(PropertiesParameterPanel panel)Adds the value to the panel.StringdefaultValueTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.StringextensionsTipText()Returns the tip text for this property.StringfileChooserTitleTipText()Returns the tip text for this property.booleangetAcceptAllFileFilter()Returns whether to show the 'All files' filter.PlaceholderFilegetDefaultValue()Returns the default of the value.StringgetDefaultValueAsString()Returns the default of the value as string.BaseString[]getExtensions()Returns the extension on offer in the file chooser.StringgetFileChooserTitle()Returns the title for the file chooser dialog.PlaceholderDirectorygetInitialDirectory()Returns the initial directory.booleangetMultiSelect()Returns whether multiple files can be selected.PropertiesParameterPanel.PropertyTypegetType()Returns the type of the value.booleangetUseAbsolutePath()Returns whether to use absolute paths.booleangetUseForwardSlashes()Returns whether to use forward slashes in the output.StringglobalInfo()Returns a string describing the object.StringheadlessInteraction()Prompts the user to enter a value in headless mode and returns it.StringinitialDirectoryTipText()Returns the tip text for this property.StringmultiSelectTipText()Returns the tip text for this property.protected booleanrequiresFlowContext()Returns whether flow context is required.voidsetAcceptAllFileFilter(boolean value)Sets whether to show the 'All files' filter.voidsetDefaultValue(PlaceholderFile value)Sets the default of the value.voidsetDefaultValueAsString(String value)Sets the default value as string.voidsetExtensions(BaseString[] value)Sets the extensions to offer in the file chooser.voidsetFileChooserTitle(String value)Sets the title for the file chooser dialog.voidsetInitialDirectory(PlaceholderDirectory value)Sets the initial directory.voidsetMultiSelect(boolean value)Sets whether multiple files can be selected.voidsetUseAbsolutePath(boolean value)Sets whether to use absolute paths.voidsetUseForwardSlashes(boolean value)Sets whether to use forward slashes in the output.StringuseAbsolutePathTipText()Returns the tip text for this property.StringuseForwardSlashesTipText()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_InitialDirectory
protected PlaceholderDirectory m_InitialDirectory
the initial directory.
-
m_DefaultValue
protected PlaceholderFile m_DefaultValue
the default file.
-
m_Extensions
protected BaseString[] m_Extensions
the extensions to offer in the file chooser.
-
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.
-
m_AcceptAllFileFilter
protected boolean m_AcceptAllFileFilter
whether to allow the "All files" filter.
-
m_MultiSelect
protected boolean m_MultiSelect
whether to select multiple files.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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.
-
setInitialDirectory
public void setInitialDirectory(PlaceholderDirectory value)
Sets the initial directory.- Parameters:
value- the initial directory
-
getInitialDirectory
public PlaceholderDirectory getInitialDirectory()
Returns the initial directory.- Returns:
- the initial directory
-
initialDirectoryTipText
public String initialDirectoryTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setExtensions
public void setExtensions(BaseString[] value)
Sets the extensions to offer in the file chooser.- Parameters:
value- the extensions
-
getExtensions
public BaseString[] getExtensions()
Returns the extension on offer in the file chooser.- Returns:
- the extensions
-
extensionsTipText
public String extensionsTipText()
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(PlaceholderFile value)
Sets the default of the value.- Parameters:
value- the default
-
getDefaultValue
public PlaceholderFile 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:
setUseForwardSlashesin interfaceForwardSlashSupporter- Parameters:
value- if true then use forward slashes
-
getUseForwardSlashes
public boolean getUseForwardSlashes()
Returns whether to use forward slashes in the output.- Specified by:
getUseForwardSlashesin interfaceForwardSlashSupporter- Returns:
- true if forward slashes are used
-
useForwardSlashesTipText
public String useForwardSlashesTipText()
Returns the tip text for this property.- Specified by:
useForwardSlashesTipTextin 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:
setUseAbsolutePathin interfaceAbsolutePathSupporter- Parameters:
value- if true if absolute paths
-
getUseAbsolutePath
public boolean getUseAbsolutePath()
Returns whether to use absolute paths.- Specified by:
getUseAbsolutePathin 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.
-
setAcceptAllFileFilter
public void setAcceptAllFileFilter(boolean value)
Sets whether to show the 'All files' filter.- Parameters:
value- true if to show
-
getAcceptAllFileFilter
public boolean getAcceptAllFileFilter()
Returns whether to show the 'All files' filter.- Returns:
- true if to show
-
acceptAllFileFilterTipText
public String acceptAllFileFilterTipText()
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 multiple files can be selected.- Parameters:
value- true if can select multiple files
-
getMultiSelect
public boolean getMultiSelect()
Returns whether multiple files can be selected.- Returns:
- true if can select multiple files
-
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.
-
requiresFlowContext
protected boolean requiresFlowContext()
Returns whether flow context is required.- Specified by:
requiresFlowContextin classAbstractValueDefinition- Returns:
- true if required
-
getType
public PropertiesParameterPanel.PropertyType getType()
Returns the type of the value.- Specified by:
getTypein classAbstractValueDefinition- Returns:
- the type
-
setDefaultValueAsString
public void setDefaultValueAsString(String value)
Sets the default value as string.- Specified by:
setDefaultValueAsStringin classAbstractValueDefinition- Parameters:
value- the default value
-
getDefaultValueAsString
public String getDefaultValueAsString()
Returns the default of the value as string.- Specified by:
getDefaultValueAsStringin classAbstractValueDefinition- Returns:
- the default
-
addToPanel
public boolean addToPanel(PropertiesParameterPanel panel)
Adds the value to the panel.- Specified by:
addToPanelin 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:
headlessInteractionin classAbstractValueDefinition- Returns:
- the entered value, null if canceled
-
-