Class 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 Detail

      • m_Cmd

        protected String m_Cmd
        the command to run.
      • 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 panel
        cmd - 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 panel
        cmd - the command to execute
        code - 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
      • toString

        public String toString()
        Returns a string representation.
        Overrides:
        toString in class Object
        Returns:
        a string