Package adams.gui.scripting
Class ScriptingCommand
- java.lang.Object
-
- adams.gui.scripting.ScriptingCommand
-
public class ScriptingCommand extends Object
A container object for a scripting command with optional code to execute when finished.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected BasePanelm_BasePanelthe affected base panel.protected Stringm_Cmdthe command to run.protected ScriptingCommandCodem_Codethe (optional) code to execute.
-
Constructor Summary
Constructors Constructor Description ScriptingCommand(BasePanel panel, String cmd)Initializes the command with no code to execute.ScriptingCommand(BasePanel panel, String cmd, ScriptingCommandCode code)Initializes the command with the code to execute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasePanelgetBasePanel()Returns the affected base panel.ScriptingCommandCodegetCode()Returns the optional code to execute.StringgetCommand()Returns the underlying command to execute.booleanhasCode()Returns whether any code is available to execute.StringtoString()Returns a string representation.
-
-
-
Field Detail
-
m_Cmd
protected String m_Cmd
the command to run.
-
m_Code
protected ScriptingCommandCode m_Code
the (optional) code to execute.
-
m_BasePanel
protected BasePanel m_BasePanel
the affected base panel.
-
-
Constructor Detail
-
ScriptingCommand
public ScriptingCommand(BasePanel panel, String cmd)
Initializes the command with no code to execute.- Parameters:
panel- the affected panelcmd- the command to execute
-
ScriptingCommand
public ScriptingCommand(BasePanel panel, String cmd, ScriptingCommandCode code)
Initializes the command with the code to execute.- Parameters:
panel- the affected panelcmd- the command to executecode- the code to execute, ignored if null
-
-
Method Detail
-
getCommand
public String getCommand()
Returns the underlying command to execute.- Returns:
- the command
-
getBasePanel
public BasePanel getBasePanel()
Returns the affected base panel.- Returns:
- the panel
-
hasCode
public boolean hasCode()
Returns whether any code is available to execute.- Returns:
- true if code is available
-
getCode
public ScriptingCommandCode getCode()
Returns the optional code to execute.- Returns:
- the code, can be null
-
-