TPTP 4.4.0 Testing Tools Project
Internal API Specification

org.eclipse.tptp.test.auto.gui.internal.commands
Class PositionBasedCommand

java.lang.Object
  extended byorg.eclipse.tptp.test.auto.gui.internal.macro.AbstractMacroInstruction
      extended byorg.eclipse.tptp.test.auto.gui.internal.commands.AbstractMacroCommand
          extended byorg.eclipse.tptp.test.auto.gui.internal.commands.PositionBasedCommand
All Implemented Interfaces:
IMacroCommand, IMacroInstruction, IPlayable, IWritable
Direct Known Subclasses:
KeyEventCommand, MouseEventCommand

public abstract class PositionBasedCommand
extends AbstractMacroCommand

An abstract representation of position-based commands


Field Summary
 
Fields inherited from class org.eclipse.tptp.test.auto.gui.internal.commands.AbstractMacroCommand
DESCRIPTIVE_FIELD_BOUND
 
Constructor Summary
PositionBasedCommand(MacroCommandShell parent, WidgetIdentifier wi)
           
 
Method Summary
abstract  org.eclipse.swt.widgets.Event[] constructSWTEvents()
          Constructs the SWT event that will be played back
abstract  int getDetail()
          Returns a field that is required to complete the string serialization of the command.
abstract  java.lang.String getType()
          The type of the event
 boolean playback(org.eclipse.swt.widgets.Display display, org.eclipse.swt.widgets.Composite parent, org.eclipse.core.runtime.IProgressMonitor monitor)
          Plays back this command
abstract  void processEvent(org.eclipse.swt.widgets.Event e)
          A chance for the command to process the original SWT event
 void write(int indent, java.lang.StringBuffer sb, boolean close, boolean end)
          String serialize this event
 
Methods inherited from class org.eclipse.tptp.test.auto.gui.internal.commands.AbstractMacroCommand
equals, findDescriptiveField, findDescriptiveField, getDescriptiveField, getObjectClassName, getParent, getText, getTimeDifference, isRepeatRedundant, load, mergeEvent, setDescriptiveField, setParent, setTimeDifference, toString, write, writeFinish, writeStart
 
Methods inherited from class org.eclipse.tptp.test.auto.gui.internal.macro.AbstractMacroInstruction
bindSourceLocation, getCorrespondingObject, getStartLine, getStopLine, getWidgetId, setCorrespondingObject, setWidgetId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.tptp.test.auto.gui.internal.core.IMacroInstruction
getCorrespondingObject, getStartLine, getStopLine, getWidgetId, setCorrespondingObject, setWidgetId
 

Constructor Detail

PositionBasedCommand

public PositionBasedCommand(MacroCommandShell parent,
                            WidgetIdentifier wi)
Method Detail

getType

public abstract java.lang.String getType()
The type of the event

Returns:
The type

processEvent

public abstract void processEvent(org.eclipse.swt.widgets.Event e)
A chance for the command to process the original SWT event

Parameters:
e - The event that awaits processing

getDetail

public abstract int getDetail()
Returns a field that is required to complete the string serialization of the command.

Returns:
A detail field (for mouse events it corresponds to the button pressed/released and for key events it corresponds to the key pressed/released

constructSWTEvents

public abstract org.eclipse.swt.widgets.Event[] constructSWTEvents()
Constructs the SWT event that will be played back

Returns:
The SWT event

write

public void write(int indent,
                  java.lang.StringBuffer sb,
                  boolean close,
                  boolean end)
String serialize this event

Overrides:
write in class AbstractMacroCommand
Parameters:
indent - The current indent that the command should be at
close - A flag that indicates whether the command fragment should be closed (i.e.adding "/" to the end).
end - A flag that indicates whether the command fragment should end (i.e.adding "/" to the end).

playback

public boolean playback(org.eclipse.swt.widgets.Display display,
                        org.eclipse.swt.widgets.Composite parent,
                        org.eclipse.core.runtime.IProgressMonitor monitor)
                 throws org.eclipse.core.runtime.CoreException
Plays back this command

Throws:
org.eclipse.core.runtime.CoreException

TPTP 4.4.0 Testing Tools Project
Internal API Specification