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

com.tplan.robot.scripting
Class ScriptEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.tplan.robot.scripting.ScriptEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ScriptDebuggingEvent

public class ScriptEvent
extends java.util.EventObject

Script events describe events related to test script execution like start, stop and pause, execution of particular commands etc.

See Also:
Serialized Form

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


Field Summary
static int SCRIPT_BLOCK_EXECUTION_FINISHED
          Notify listeners that execution of a block (a structure or a Run call) finished.
static int SCRIPT_CLIENT_CREATED
          Notify listeners that a new remote desktop client was created.
static int SCRIPT_CMD_COMPARISON_END
           
static int SCRIPT_CMD_COMPARISON_FAILED_FOR_IO_ERROR
          Fired when an executing script experiences a failed image comparison (one or more template images are missing or can not be read).
static int SCRIPT_CMD_COMPARISON_FAILED_FOR_MISMATCH
          Fired when an executing script experiences a failed image comparison (the screen does not match).
static int SCRIPT_CMD_COMPARISON_START
           
static int SCRIPT_CMD_MOUSE_END
           
static int SCRIPT_CMD_MOUSE_START
           
static int SCRIPT_COMPILATION_FINISHED
          Fired when script compilation finishes.
static int SCRIPT_COMPILATION_STARTED
          Notify listeners that the compile process was started.
static int SCRIPT_ERRORS_AVAILABLE
          Fired when script compilation finishes and list of errors is available.
static int SCRIPT_EXECUTED_LINE_CHANGED
          Fired when execution jumps to another line of code.
static int SCRIPT_EXECUTING_INCLUDE
          Notify listeners that either Include or Run command is to be executed.
static int SCRIPT_EXECUTION_FINISHED
          Fired when the execution finishes.
static int SCRIPT_EXECUTION_PAUSED
          Notify listeners that execution was paused either by the Pause command or manually by the user.
static int SCRIPT_EXECUTION_RESUMED
          Notify listeners that previously paused execution has resumed.
static int SCRIPT_EXECUTION_SIGNOFF
          Fired when execution finishes after the SCRIPT_EXECUTION_FINISHED event.
static int SCRIPT_EXECUTION_STARTED
          Fired when script execution is starting.
static int SCRIPT_EXECUTION_STOPPED
          Fired when execution gets stopped manually.
static int SCRIPT_GOING_TO_RUN_LINE
          This event type indicates that the script handler is going to run a line of code.
static int SCRIPT_INCLUDE_FAILED
          Notify listeners that an Include or Run command failed to open the specified file.
static int SCRIPT_INTERPRET_DESTROYED
          Notify listeners that the script was destroyed and should not be used any more..
static int SCRIPT_INTERPRET_INITIALIZED
          Notify listeners that the script was initialized (associated with a file/URI).
static int SCRIPT_MESSAGE_AVAILABLE
          Fired when a displayable message is available.
static int SCRIPT_NESTED_INTERPRET_CREATED
          Notify listeners that a nested interpret was created.
static int SCRIPT_PAUSE_FLAG_CHANGED
          Notify listeners that the pause flag has changed.
static int SCRIPT_PROCEDURE_FINISHED
          Fired when execution of a procedure finishes.
static int SCRIPT_PROCEDURE_STARTED
          Fired when execution of a procedure is starting.
static int SCRIPT_REPORT_FIRST_CREATED
          Notify listeners that a new report has been created for the first time (refresh operations should not fire this any more).
static int SCRIPT_VARIABLES_UPDATED
          Fired when variables stored in the context have changed.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ScriptEvent(java.lang.Object source, TestScriptInterpret interpret, ScriptingContext context, int type)
           
ScriptEvent(java.lang.Object source, TestScriptInterpret interpret, ScriptingContext context, java.lang.String message)
           
ScriptEvent(TestScriptInterpret interpret, ScriptingContext context, int type)
           
ScriptEvent(TestScriptInterpret interpret, ScriptingContext context, java.lang.String message)
           
 
Method Summary
 ScriptingContext getContext()
           
 java.lang.Object getCustomObject()
           
 TestScriptInterpret getInterpret()
          Get test script interpret associated with this event
 java.lang.String getMessage()
           
 ScriptManager getScriptManager()
          Get script manager associated with this event
 java.lang.Object getSource()
           
 int getType()
           
 TestWrapper getWrapper()
           
 void setCustomObject(java.lang.Object customObject)
           
 
Methods inherited from class java.util.EventObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCRIPT_COMPILATION_FINISHED

public static final int SCRIPT_COMPILATION_FINISHED
Fired when script compilation finishes.

See Also:
Constant Field Values

SCRIPT_EXECUTION_STARTED

public static final int SCRIPT_EXECUTION_STARTED
Fired when script execution is starting.

See Also:
Constant Field Values

SCRIPT_PROCEDURE_STARTED

public static final int SCRIPT_PROCEDURE_STARTED
Fired when execution of a procedure is starting.

See Also:
Constant Field Values

SCRIPT_PROCEDURE_FINISHED

public static final int SCRIPT_PROCEDURE_FINISHED
Fired when execution of a procedure finishes.

See Also:
Constant Field Values

SCRIPT_EXECUTED_LINE_CHANGED

public static final int SCRIPT_EXECUTED_LINE_CHANGED
Fired when execution jumps to another line of code. This type of event is typically consumed by editors which highlight the executed line of code. The element itself is available through the context.

See Also:
Constant Field Values

SCRIPT_MESSAGE_AVAILABLE

public static final int SCRIPT_MESSAGE_AVAILABLE
Fired when a displayable message is available. This type of event is typically consumed by GUI components like status bar.

See Also:
Constant Field Values

SCRIPT_VARIABLES_UPDATED

public static final int SCRIPT_VARIABLES_UPDATED
Fired when variables stored in the context have changed.

See Also:
Constant Field Values

SCRIPT_ERRORS_AVAILABLE

public static final int SCRIPT_ERRORS_AVAILABLE
Fired when script compilation finishes and list of errors is available. This type of event is typically consumed by editors which highlight invalid lines of code.

See Also:
Constant Field Values

SCRIPT_EXECUTION_STOPPED

public static final int SCRIPT_EXECUTION_STOPPED
Fired when execution gets stopped manually.

See Also:
Constant Field Values

SCRIPT_EXECUTION_FINISHED

public static final int SCRIPT_EXECUTION_FINISHED
Fired when the execution finishes.

See Also:
Constant Field Values

SCRIPT_EXECUTING_INCLUDE

public static final int SCRIPT_EXECUTING_INCLUDE
Notify listeners that either Include or Run command is to be executed. It is typically consumed by GUI components which for example open the file in editor. Note that this event type uses the event custom object to pass a File instance representing the included file.

See Also:
Constant Field Values

SCRIPT_INCLUDE_FAILED

public static final int SCRIPT_INCLUDE_FAILED
Notify listeners that an Include or Run command failed to open the specified file.

See Also:
Constant Field Values

SCRIPT_EXECUTION_PAUSED

public static final int SCRIPT_EXECUTION_PAUSED
Notify listeners that execution was paused either by the Pause command or manually by the user. Note that this event type uses the event custom object to store a String instance representing reason of the pause.

See Also:
Constant Field Values

SCRIPT_EXECUTION_RESUMED

public static final int SCRIPT_EXECUTION_RESUMED
Notify listeners that previously paused execution has resumed.

See Also:
Constant Field Values

SCRIPT_PAUSE_FLAG_CHANGED

public static final int SCRIPT_PAUSE_FLAG_CHANGED
Notify listeners that the pause flag has changed.

See Also:
Constant Field Values

SCRIPT_GOING_TO_RUN_LINE

public static final int SCRIPT_GOING_TO_RUN_LINE
This event type indicates that the script handler is going to run a line of code. If any of the listeners throws a PauseRequestException, the script handler will interpret it as a request to pause execution on that particular line. This mechanism is used by the script editor to implement breakpoints.

See Also:
Constant Field Values

SCRIPT_CLIENT_CREATED

public static final int SCRIPT_CLIENT_CREATED
Notify listeners that a new remote desktop client was created.

See Also:
Constant Field Values

SCRIPT_COMPILATION_STARTED

public static final int SCRIPT_COMPILATION_STARTED
Notify listeners that the compile process was started.

See Also:
Constant Field Values

SCRIPT_NESTED_INTERPRET_CREATED

public static final int SCRIPT_NESTED_INTERPRET_CREATED
Notify listeners that a nested interpret was created.

See Also:
Constant Field Values

SCRIPT_REPORT_FIRST_CREATED

public static final int SCRIPT_REPORT_FIRST_CREATED
Notify listeners that a new report has been created for the first time (refresh operations should not fire this any more).

See Also:
Constant Field Values

SCRIPT_CMD_MOUSE_START

public static final int SCRIPT_CMD_MOUSE_START
See Also:
Constant Field Values

SCRIPT_CMD_MOUSE_END

public static final int SCRIPT_CMD_MOUSE_END
See Also:
Constant Field Values

SCRIPT_CMD_COMPARISON_START

public static final int SCRIPT_CMD_COMPARISON_START
See Also:
Constant Field Values

SCRIPT_CMD_COMPARISON_END

public static final int SCRIPT_CMD_COMPARISON_END
See Also:
Constant Field Values

SCRIPT_EXECUTION_SIGNOFF

public static final int SCRIPT_EXECUTION_SIGNOFF
Fired when execution finishes after the SCRIPT_EXECUTION_FINISHED event. It is typically used by objects that need to perform something after the script execution sign off.

See Also:
Constant Field Values

SCRIPT_BLOCK_EXECUTION_FINISHED

public static final int SCRIPT_BLOCK_EXECUTION_FINISHED
Notify listeners that execution of a block (a structure or a Run call) finished.

See Also:
Constant Field Values

SCRIPT_INTERPRET_DESTROYED

public static final int SCRIPT_INTERPRET_DESTROYED
Notify listeners that the script was destroyed and should not be used any more..

See Also:
Constant Field Values

SCRIPT_CMD_COMPARISON_FAILED_FOR_MISMATCH

public static final int SCRIPT_CMD_COMPARISON_FAILED_FOR_MISMATCH
Fired when an executing script experiences a failed image comparison (the screen does not match).

Since:
3.5
See Also:
Constant Field Values

SCRIPT_CMD_COMPARISON_FAILED_FOR_IO_ERROR

public static final int SCRIPT_CMD_COMPARISON_FAILED_FOR_IO_ERROR
Fired when an executing script experiences a failed image comparison (one or more template images are missing or can not be read).

Since:
3.5
See Also:
Constant Field Values

SCRIPT_INTERPRET_INITIALIZED

public static final int SCRIPT_INTERPRET_INITIALIZED
Notify listeners that the script was initialized (associated with a file/URI).

See Also:
Constant Field Values
Constructor Detail

ScriptEvent

public ScriptEvent(java.lang.Object source,
                   TestScriptInterpret interpret,
                   ScriptingContext context,
                   int type)

ScriptEvent

public ScriptEvent(java.lang.Object source,
                   TestScriptInterpret interpret,
                   ScriptingContext context,
                   java.lang.String message)

ScriptEvent

public ScriptEvent(TestScriptInterpret interpret,
                   ScriptingContext context,
                   int type)

ScriptEvent

public ScriptEvent(TestScriptInterpret interpret,
                   ScriptingContext context,
                   java.lang.String message)
Method Detail

getType

public int getType()
Returns:
the type

getContext

public ScriptingContext getContext()
Returns:
the context

getWrapper

public TestWrapper getWrapper()
Returns:
the wrapper

getMessage

public java.lang.String getMessage()
Returns:
the message

getCustomObject

public java.lang.Object getCustomObject()
Returns:
the customObject

setCustomObject

public void setCustomObject(java.lang.Object customObject)
Parameters:
customObject - the customObject to set

getInterpret

public TestScriptInterpret getInterpret()
Get test script interpret associated with this event

Returns:
the test script interpret associated with this event.

getScriptManager

public ScriptManager getScriptManager()
Get script manager associated with this event

Returns:
the script manager associated with this event.

getSource

public java.lang.Object getSource()
Overrides:
getSource in class java.util.EventObject

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