|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.extensions.awt.editor.Recorder
Template for recording AWTEvents and converting them into a more semantic event. The base Recorder class handles cancellation and the main wait task; the concrete implementation determines when event collection has gathered sufficient information to construct an action, at which point shouldStop should return true. createStep is then invoked to generate the final result.
Constructor Summary | |
Recorder(Resolver resolver,
ComponentFinder finder,
java.awt.event.ActionListener l)
Create a Recorder for use in capturing the semantics of a GUI action. |
Method Summary | |
void |
cancel(java.lang.String why)
Cancel the current recording. |
protected abstract Step |
createStep()
Create a script step based on the information gathered so far. |
protected abstract void |
eventDispatched(java.awt.AWTEvent event)
Handle an action. |
protected java.lang.String |
eventToString(java.awt.AWTEvent event)
|
long |
getEventMask()
Return the events of interest to this Recorder. |
protected ComponentFinder |
getFinder()
Return the ComponentFinder to be used by this recorder. |
abstract java.lang.String |
getName()
Return the name of the type of GUI action to be recorded. |
protected Resolver |
getResolver()
Return the Resolver to be used by this recorder. |
protected void |
initialize()
Set up state prior to capturing events. |
boolean |
isCancelEvent(java.awt.AWTEvent event)
Default method of canceling an action is to hit the escape key. |
Step |
record()
Record the GUI action. |
void |
recordEvent(java.awt.AWTEvent event)
Verify the recording is still active prior to handling an event. |
void |
setResolver(Resolver resolver)
The context into which we add component references may change. |
protected void |
setStatus(java.lang.String msg)
Indicate the current recording state, so that the status may be displayed elsewhere. |
protected boolean |
shouldStop()
Override this to indicate when the recording whould terminate (not cancel. |
protected java.lang.String |
simpleClassName(java.lang.Class cls)
|
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Recorder(Resolver resolver, ComponentFinder finder, java.awt.event.ActionListener l)
Method Detail |
public abstract java.lang.String getName()
public void setResolver(Resolver resolver)
protected void initialize()
protected boolean shouldStop()
protected abstract Step createStep()
public Step record() throws RecordingCanceledException
public void cancel(java.lang.String why)
protected abstract void eventDispatched(java.awt.AWTEvent event)
public boolean isCancelEvent(java.awt.AWTEvent event)
public void recordEvent(java.awt.AWTEvent event)
public long getEventMask()
protected ComponentFinder getFinder()
protected Resolver getResolver()
protected void setStatus(java.lang.String msg)
protected java.lang.String simpleClassName(java.lang.Class cls)
protected java.lang.String eventToString(java.awt.AWTEvent event)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |