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 Stringm_Messagethe message for the user.protected booleanm_RestoreEnabledwhether to enable automatic restore of values.protected Stringm_RestoreFilethe name of the restore file.protected VariableNamem_RestoreVarthe name of the restore variable.protected AbstractValueDefinition[]m_Valuesthe 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 voiddefineOptions()Adds options to the internal list of options.protected ActordoGenerate()Generates the actor.StringgetMessage()Returns the message the user is prompted with.booleangetRestoreEnabled()Returns whether to automatically restore the EnterManyValues settings.StringgetRestoreFile()Returns the file to store the settings in.VariableNamegetRestoreVar()Returns the variable name to use for the restore file.AbstractValueDefinition[]getValues()Returns the value definitions.StringglobalInfo()Returns a string describing the object.booleanisInteractive()Whether the flow generated is an interactive one.StringmessageTipText()Returns the tip text for this property.StringrestoreEnabledTipText()Returns the tip text for this property.StringrestoreFileTipText()Returns the tip text for this property.StringrestoreVarTipText()Returns the tip text for this property.voidsetMessage(String value)Sets the message to prompt the user with.voidsetRestoreEnabled(boolean value)Sets whether to automatically restore the EnterManyValues settings.voidsetRestoreFile(String value)Sets the file to store the settings in.voidsetRestoreVar(VariableName value)Sets the variable name to use for the restore file.voidsetValues(AbstractValueDefinition[] value)Sets the value definitions.StringvaluesTipText()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:
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 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:
isInteractivein classAbstractActorTemplate- Returns:
- true if interactive
-
doGenerate
protected Actor doGenerate()
Generates the actor.- Specified by:
doGeneratein classAbstractActorTemplate- Returns:
- the generated acto
-
-