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 BasePanel
m_BasePanel
the affected base panel.protected String
m_Cmd
the command to run.protected ScriptingCommandCode
m_Code
the (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 BasePanel
getBasePanel()
Returns the affected base panel.ScriptingCommandCode
getCode()
Returns the optional code to execute.String
getCommand()
Returns the underlying command to execute.boolean
hasCode()
Returns whether any code is available to execute.String
toString()
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
-
-