Package adams.flow.template
Class PromptUser
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractActorTemplate>
,SizeOfHandler
,Serializable
public class PromptUser extends AbstractActorTemplate
Generates a sub-flow that prompts the user with the specified parameters and stores the values in variables.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-name <java.lang.String> (property: name) The new name for the actor; leave empty to use current. default:
-message <java.lang.String> (property: message) The message to prompt the user with. default: Please enter values
-value <adams.flow.source.valuedefinition.AbstractValueDefinition> [-value ...] (property: values) The value definitions that define the dialog prompting the user to enter the values. default:
-restore-enabled <boolean> (property: restoreEnabled) If enabled, the adams.flow.source.EnterManyValues actor will get set up to automatically restore its values. default: false
-restore-var <adams.core.VariableName> (property: restoreVar) The name of the variable to use for storing the restore file. default: restore
-restore-file <java.lang.String> (property: restoreFile) The file to store the settings in. default: @{flow_filename_long}.props
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Message
the message for the user.protected boolean
m_RestoreEnabled
whether to enable automatic restore of values.protected String
m_RestoreFile
the name of the restore file.protected VariableName
m_RestoreVar
the name of the restore variable.protected AbstractValueDefinition[]
m_Values
the value definitions.-
Fields inherited from class adams.flow.template.AbstractActorTemplate
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 PromptUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected Actor
doGenerate()
Generates the actor.String
getMessage()
Returns the message the user is prompted with.boolean
getRestoreEnabled()
Returns whether to automatically restore the EnterManyValues settings.String
getRestoreFile()
Returns the file to store the settings in.VariableName
getRestoreVar()
Returns the variable name to use for the restore file.AbstractValueDefinition[]
getValues()
Returns the value definitions.String
globalInfo()
Returns a string describing the object.boolean
isInteractive()
Whether the flow generated is an interactive one.String
messageTipText()
Returns the tip text for this property.String
restoreEnabledTipText()
Returns the tip text for this property.String
restoreFileTipText()
Returns the tip text for this property.String
restoreVarTipText()
Returns the tip text for this property.void
setMessage(String value)
Sets the message to prompt the user with.void
setRestoreEnabled(boolean value)
Sets whether to automatically restore the EnterManyValues settings.void
setRestoreFile(String value)
Sets the file to store the settings in.void
setRestoreVar(VariableName value)
Sets the variable name to use for the restore file.void
setValues(AbstractValueDefinition[] value)
Sets the value definitions.String
valuesTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.template.AbstractActorTemplate
compareTo, equals, forCommandLine, forName, generate, getBaselineCorrections, getDefaultName, getName, nameTipText, postGenerate, preGenerate, setName, shallowCopy, shallowCopy
-
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Message
protected String m_Message
the message for the user.
-
m_Values
protected AbstractValueDefinition[] m_Values
the value definitions.
-
m_RestoreEnabled
protected boolean m_RestoreEnabled
whether to enable automatic restore of values.
-
m_RestoreVar
protected VariableName m_RestoreVar
the name of the restore variable.
-
m_RestoreFile
protected String m_RestoreFile
the name of the restore file.
-
-
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 classAbstractActorTemplate
-
setMessage
public void setMessage(String value)
Sets the message to prompt the user with.- Parameters:
value
- the message
-
getMessage
public String getMessage()
Returns the message the user is prompted with.- Returns:
- the message
-
messageTipText
public String messageTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setValues
public void setValues(AbstractValueDefinition[] value)
Sets the value definitions.- Parameters:
value
- the definitions
-
getValues
public AbstractValueDefinition[] getValues()
Returns the value definitions.- Returns:
- the definitions
-
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.
-
setRestoreEnabled
public void setRestoreEnabled(boolean value)
Sets whether to automatically restore the EnterManyValues settings.- Parameters:
value
- true if to restore
-
getRestoreEnabled
public boolean getRestoreEnabled()
Returns whether to automatically restore the EnterManyValues settings.- Returns:
- true if to restore
-
restoreEnabledTipText
public String restoreEnabledTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRestoreVar
public void setRestoreVar(VariableName value)
Sets the variable name to use for the restore file.- Parameters:
value
- the variable name
-
getRestoreVar
public VariableName getRestoreVar()
Returns the variable name to use for the restore file.- Returns:
- the variable name
-
restoreVarTipText
public String restoreVarTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRestoreFile
public void setRestoreFile(String value)
Sets the file to store the settings in.- Parameters:
value
- the settings file
-
getRestoreFile
public String getRestoreFile()
Returns the file to store the settings in.- Returns:
- the settings file
-
restoreFileTipText
public String restoreFileTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
isInteractive
public boolean isInteractive()
Whether the flow generated is an interactive one.- Specified by:
isInteractive
in classAbstractActorTemplate
- Returns:
- true if interactive
-
doGenerate
protected Actor doGenerate()
Generates the actor.- Specified by:
doGenerate
in classAbstractActorTemplate
- Returns:
- the generated acto
-
-