Class ScriptingEvent

  • All Implemented Interfaces:
    Serializable

    public class ScriptingEvent
    extends EventObject
    Gets sent when a scripting event happened.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Success

        protected boolean m_Success
        whether the command was successfully run.
      • m_Error

        protected String m_Error
        optional error message.
    • Constructor Detail

      • ScriptingEvent

        public ScriptingEvent​(Object source,
                              ScriptingCommand cmd,
                              boolean success)
        Initializes the object.
        Parameters:
        source - the object that triggered the command
        cmd - the command that was run
        success - whether the command was successfully run
      • ScriptingEvent

        public ScriptingEvent​(Object source,
                              ScriptingCommand cmd,
                              boolean success,
                              String error)
        Initializes the object.
        Parameters:
        source - the object that triggered the command
        cmd - the command that was run
        success - whether the command was successfully run
        error - an error message (or null if none)
    • Method Detail

      • getCmd

        public ScriptingCommand getCmd()
        Returns the command that was run.
        Returns:
        the command
      • getSuccess

        public boolean getSuccess()
        Returns whether the command was run successfully or not.
        Returns:
        true if the command was run successfully
      • hasError

        public boolean hasError()
        Returns whether an error message is available.
        Returns:
        true if an error message is available
      • getError

        public String getError()
        Returns the error message.
        Returns:
        the error message, null if none available
      • toString

        public String toString()
        Returns a string representation of the event object.
        Overrides:
        toString in class EventObject
        Returns:
        the string representation