abbot.editor
Class ScriptEditor

java.lang.Object
  |
  +--abbot.editor.ScriptEditor
All Implemented Interfaces:
ActionListener, EditorConstants, EventListener, Resolver

public class ScriptEditor
extends Object
implements ActionListener, Resolver, EditorConstants

Costello, the editor for Abbot scripts.

Acts as a resolver, using the currently in-context script as the component resolver.


Inner classes inherited from class abbot.editor.EditorConstants
EditorConstants.Accelerator
 
Field Summary
static int KC_INVERT
          Key to use to invert an assertion/wait.
static int KC_WAIT
          Key to use to insert a wait instead of an assertion.
 
Fields inherited from interface abbot.editor.EditorConstants
ABBOT_IMAGE_DIR, LARGE_ICON, menuShortcutMask, menuShortcutString, MI_ABOUT, MI_ACTION_COUNT, MI_ASSERT_DYNAMIC, MI_CAPTURE_DYNAMIC, MI_CLEAR, MI_CLOSE, MI_COUNT, MI_CUT, MI_DELETE, MI_DUPLICATE, MI_EXIT, MI_EXPORT_HIERARCHY, MI_FORK, MI_GETVMARGS, MI_GROUP, MI_INSERT_ANNOTATION, MI_INSERT_CALL, MI_INSERT_COMMENT, MI_INSERT_COUNT, MI_INSERT_DYNAMIC, MI_INSERT_FIRST, MI_INSERT_LAST, MI_INSERT_LAUNCH, MI_INSERT_SAMPLE, MI_INSERT_SCRIPT, MI_INSERT_SEQUENCE, MI_INSERT_TERMINATE, MI_LAUNCH, MI_MOVE_DOWN, MI_MOVE_UP, MI_NEW, MI_OPEN, MI_RENAME, MI_RUN, MI_RUNSELECTED, MI_RUNTO, MI_SAVE, MI_SAVE_AS, MI_SELECT_TESTSUITE, MI_SLOW, MI_STOP_ON_ERROR, MI_STOP_ON_FAILURE, MI_TERMINATE, MI_TOGGLE_FIRST, MI_TOGGLE_LAST, MI_WAIT_DYNAMIC
 
Constructor Summary
ScriptEditor()
          Constructs a ScriptEditor with the specified view
 
Method Summary
(package private) static void ()
           
 void actionPerformed(ActionEvent ev)
          Respond to various components.
 ComponentReference addComponent(Component comp)
          From abbot.Resolver.
 void addComponentReference(ComponentReference ref)
          From abbot.Resolver.
(package private)  void addStep(Step step)
          Insert a new step at the current cursor location.
(package private)  void dispose()
           
 String getComponentID(Component comp)
          Returns null if not found.
 ComponentReference getComponentReference(Component comp)
          From abbot.Resolver.
 ComponentReference getComponentReference(String refid)
          From abbot.Resolver.
 Collection getComponentReferences()
          From abbot.Resolver.
 File getDirectory()
          From abbot.Resolver.
 String getProperty(String name)
          From abbot.Resolver.
 String getUniqueID(ComponentReference ref)
          From abbot.Resolver.
(package private)  void insertLaunch()
          Insert a blank launch step.
(package private)  void insertTerminate()
          Insert a terminate step.
static void main(String[] args)
          Launch the script editor, with an argument of either a test suite class or a script filename.
(package private)  void newScript(File file, boolean copyFixture)
          Create a new script at the given filename, or open it if it already exists.
static void setDocumentationProperties(String[] action)
          Deprecated. Set the properties for your action directly. Install the given documentation properties, given as an array of four Strings. Add-on classes derived from ComponentTester should invoke this for each exported action. These properties are for use by the editor to better describe the available methods.

 void setProperty(String name, String value)
          From abbot.Resolver.
(package private)  void setScript(String filename)
          Set the current test script.
 void setStatus(String msg)
          Set the contents of the status message.
 void setStatus(String msg, String extended, int type)
          Set the contents of the status message.
static int showConfirmation(String msg)
           
static int showConfirmation(String msg, int opts)
           
static void showError(String msg)
          Global facility for error dialogs.
static void showError(String title, String msg)
          Global facility for error dialogs.
static String showInputDialog(String title, String msg, String initial)
          Global facility for obtaining a user input String.
static void showMessage(String title, String msg)
          Global facility for message dialogs.
static void showWarning(String msg)
          Global facility for warning dialog.
static void showWarning(String title, String msg)
          Global facility for warning dialog.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KC_INVERT

public static final int KC_INVERT
Key to use to invert an assertion/wait.

KC_WAIT

public static final int KC_WAIT
Key to use to insert a wait instead of an assertion. Use option key on mac, control key anywhere else.
Constructor Detail

ScriptEditor

public ScriptEditor()
Constructs a ScriptEditor with the specified view
Method Detail

static void ()

actionPerformed

public void actionPerformed(ActionEvent ev)
Respond to various components.
Specified by:
actionPerformed in interface ActionListener

insertLaunch

void insertLaunch()
Insert a blank launch step.

insertTerminate

void insertTerminate()
Insert a terminate step.

setScript

void setScript(String filename)
Set the current test script.

setStatus

public void setStatus(String msg)
Set the contents of the status message.

setStatus

public void setStatus(String msg,
                      String extended,
                      int type)
Set the contents of the status message.

getComponentID

public String getComponentID(Component comp)
Returns null if not found.

addStep

void addStep(Step step)
Insert a new step at the current cursor location.

newScript

void newScript(File file,
               boolean copyFixture)
Create a new script at the given filename, or open it if it already exists. Optionally copies the fixture from the current script.

getComponentReference

public ComponentReference getComponentReference(String refid)
From abbot.Resolver.
Specified by:
getComponentReference in interface Resolver

getComponentReference

public ComponentReference getComponentReference(Component comp)
From abbot.Resolver.
Specified by:
getComponentReference in interface Resolver

addComponentReference

public void addComponentReference(ComponentReference ref)
From abbot.Resolver.
Specified by:
addComponentReference in interface Resolver

addComponent

public ComponentReference addComponent(Component comp)
From abbot.Resolver.
Specified by:
addComponent in interface Resolver

getUniqueID

public String getUniqueID(ComponentReference ref)
From abbot.Resolver.
Specified by:
getUniqueID in interface Resolver

getComponentReferences

public Collection getComponentReferences()
From abbot.Resolver.
Specified by:
getComponentReferences in interface Resolver

getDirectory

public File getDirectory()
From abbot.Resolver.
Specified by:
getDirectory in interface Resolver

setProperty

public void setProperty(String name,
                        String value)
From abbot.Resolver.
Specified by:
setProperty in interface Resolver

getProperty

public String getProperty(String name)
From abbot.Resolver.
Specified by:
getProperty in interface Resolver

toString

public String toString()
Overrides:
toString in class Object

setDocumentationProperties

public static void setDocumentationProperties(String[] action)
Deprecated. Set the properties for your action directly. Install the given documentation properties, given as an array of four Strings. Add-on classes derived from ComponentTester should invoke this for each exported action. These properties are for use by the editor to better describe the available methods.


showMessage

public static void showMessage(String title,
                               String msg)
Global facility for message dialogs.

showWarning

public static void showWarning(String msg)
Global facility for warning dialog.

showWarning

public static void showWarning(String title,
                               String msg)
Global facility for warning dialog.

showInputDialog

public static String showInputDialog(String title,
                                     String msg,
                                     String initial)
Global facility for obtaining a user input String.

showError

public static void showError(String msg)
Global facility for error dialogs.

showError

public static void showError(String title,
                             String msg)
Global facility for error dialogs.

showConfirmation

public static int showConfirmation(String msg)

showConfirmation

public static int showConfirmation(String msg,
                                   int opts)

dispose

void dispose()

main

public static void main(String[] args)
Launch the script editor, with an argument of either a test suite class or a script filename.


Copyright © 2002-2003 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge