Package adams.gui.event
Class ScriptingEvent
- java.lang.Object
-
- java.util.EventObject
-
- adams.gui.event.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 Summary
Fields Modifier and Type Field Description protected ScriptingCommand
m_Cmd
the command that was run.protected String
m_Error
optional error message.protected boolean
m_Success
whether the command was successfully run.-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ScriptingEvent(Object source, ScriptingCommand cmd, boolean success)
Initializes the object.ScriptingEvent(Object source, ScriptingCommand cmd, boolean success, String error)
Initializes the object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScriptingCommand
getCmd()
Returns the command that was run.String
getError()
Returns the error message.boolean
getSuccess()
Returns whether the command was run successfully or not.boolean
hasError()
Returns whether an error message is available.String
toString()
Returns a string representation of the event object.-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Field Detail
-
m_Cmd
protected ScriptingCommand m_Cmd
the command that was run.
-
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 commandcmd
- the command that was runsuccess
- 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 commandcmd
- the command that was runsuccess
- whether the command was successfully runerror
- 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 classEventObject
- Returns:
- the string representation
-
-