T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1

com.tplan.robot.scripting.commands
Class CommandEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.tplan.robot.scripting.commands.CommandEvent
All Implemented Interfaces:
java.io.Serializable

public class CommandEvent
extends java.util.EventObject

Command events are fired by command handlers and indicate an action taken on the desktop client (pointer event, key event, ...) or a change to one of the objects in the context (new/modified variables, new screenshot generated, ...).

See Also:
Serialized Form

T-Plan Robot Enterprise, (C) 2009-2019 T-Plan Limited. All rights reserved.


Field Summary
static java.lang.String GLOBAL_VARIABLE_EVENT
          Predefined action code which indicates that a global variable was created.
static java.lang.String KEY_EVENT
          Predefined action code for a key event.
static java.lang.String LOCAL_VARIABLE_EVENT
          Predefined action code which indicates that a local variable was created.
static java.lang.String LOG_EVENT
          Predefined action code for a log entry gets generated.
static java.lang.String OUTPUT_CHANGED_EVENT
          Predefined action code for an event when a new output like screenshot, warning or comment was generated.
static java.lang.String POINTER_EVENT
          Predefined action code for a pointer event.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CommandEvent(java.lang.Object source, ScriptingContext context, java.lang.String actionCode)
           
CommandEvent(java.lang.Object source, ScriptingContext context, java.lang.String actionCode, java.lang.Object customObject)
           
 
Method Summary
 java.lang.String getActionCode()
          Get action code.
 ScriptingContext getContext()
          Get context associated with this event.
 java.lang.Object getCustomObject()
          Get custom object.
 boolean isConsumed()
          Find out whether the even is consumed or not.
 void setConsumed(boolean consumed)
          Consume the event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POINTER_EVENT

public static final java.lang.String POINTER_EVENT
Predefined action code for a pointer event. If an event with this code is created, the custom object is expected to contain a valid MouseEvent instance.

See Also:
Constant Field Values

KEY_EVENT

public static final java.lang.String KEY_EVENT
Predefined action code for a key event. If an event with this code is created, the custom object is expected to contain a valid KeyEvent instance.

See Also:
Constant Field Values

OUTPUT_CHANGED_EVENT

public static final java.lang.String OUTPUT_CHANGED_EVENT
Predefined action code for an event when a new output like screenshot, warning or comment was generated.

See Also:
Constant Field Values

LOG_EVENT

public static final java.lang.String LOG_EVENT
Predefined action code for a log entry gets generated. The custom object must be set to a string with the log text.

See Also:
Constant Field Values

GLOBAL_VARIABLE_EVENT

public static final java.lang.String GLOBAL_VARIABLE_EVENT
Predefined action code which indicates that a global variable was created.

See Also:
Constant Field Values

LOCAL_VARIABLE_EVENT

public static final java.lang.String LOCAL_VARIABLE_EVENT
Predefined action code which indicates that a local variable was created.

See Also:
Constant Field Values
Constructor Detail

CommandEvent

public CommandEvent(java.lang.Object source,
                    ScriptingContext context,
                    java.lang.String actionCode,
                    java.lang.Object customObject)

CommandEvent

public CommandEvent(java.lang.Object source,
                    ScriptingContext context,
                    java.lang.String actionCode)
Method Detail

getCustomObject

public java.lang.Object getCustomObject()
Get custom object. It is just a helper variable which allows to encapsulate an object (for example a value) into the event.

Returns:
value of the custom object field or null iv this event contains no custom object.

getActionCode

public java.lang.String getActionCode()
Get action code. It is a string which should identify what happened or type of the event. Action codes are up to particular command implementations.

Returns:
an action code.

getContext

public ScriptingContext getContext()
Get context associated with this event.

Returns:
the context

isConsumed

public boolean isConsumed()
Find out whether the even is consumed or not. A "consumed" event means that it has already reached the listener it was targeted to and it should not be forwarded to other listeners.

Returns:
the event state. The value of "true" corresponds to "consumed".

setConsumed

public void setConsumed(boolean consumed)
Consume the event. See the isConsumed() method for details.

Parameters:
consumed - true sets the event state to "consumed".

T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1