|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.jemmy.EventTool
public class EventTool
Provides methods to check last dispatched events,
to wait for events of specific types, or to guarantee that events
of specific types are not dispatched during some time frame.
All possible listeners are added during this class initialization
in case if "jemmy.event_listening" system property is not equal to "no",
so, by default, all events are listened.
Uses timeouts:
EventTool.WaitEventTimeout - time to wait for AWT events.
EventTool.WaitNoEventTimeout - when checking for the absence of incoming AWT
events.
EventTool.EventCheckingDelta - time delta between checks for AWT events.
Constructor Summary | |
---|---|
EventTool()
Constructor. |
Method Summary | |
---|---|
static void |
addListeners()
Adds listeners to listen all types of events. |
static void |
addListeners(long eventMask)
Adds listeners to listen events under mask. |
boolean |
checkNoEvent(long waitTime)
Check that no event will be dispatched during time specified. |
boolean |
checkNoEvent(long eventMask,
long waitTime)
Check that no event under mask will be dispatched during time specified. |
static long |
getCurrentEventMask()
Returns event mask last time used by addListeners(long) method. |
static AWTEvent |
getLastEvent()
Returns last dispatched event. |
static AWTEvent |
getLastEvent(long eventMask)
Returns last dispatched event under mask. |
static long |
getLastEventTime()
Returns time of the last dispatched event. |
static long |
getLastEventTime(long eventMask)
Returns time of the last dispatched event under mask. |
TestOut |
getOutput()
Returns print output streams or writers. |
static long |
getTheWholeEventMask()
Returns a combination of all AWTEvent.*_EVENT_MASK fields.. |
Timeouts |
getTimeouts()
Return current timeouts. |
static void |
removeListeners()
Removes all listeners. |
void |
setOutput(TestOut out)
Defines print output streams or writers. |
void |
setTimeouts(Timeouts ts)
Defines current timeouts. |
AWTEvent |
waitEvent()
Waits for the first event. |
AWTEvent |
waitEvent(long eventMask)
Waits for the first event under mask. |
void |
waitNoEvent(long waitTime)
During EventTool.WaitNoEventTimeout time waits for
true result of checkNoEvent(long) method. |
void |
waitNoEvent(long eventMask,
long waitTime)
During EventTool.WaitNoEventTimeout time waits for
true result of checkNoEvent(long, long) method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventTool()
Method Detail |
---|
public static long getLastEventTime(long eventMask)
eventMask
- Events types to be searched. AWTEvent.*_EVENT_MASK
fields combination.
addListeners(long)
public static AWTEvent getLastEvent(long eventMask)
eventMask
- Events types to be searched. AWTEvent.*_EVENT_MASK
fields combination.
addListeners(long)
public static long getLastEventTime()
addListeners(long)
public static AWTEvent getLastEvent()
addListeners(long)
public static void addListeners(long eventMask)
removeListeners()
first, so any event history is lost.
eventMask
- Mask to listen events under. AWTEvent.*_EVENT_MASK
fields combination.addListeners()
,
removeListeners()
public static void addListeners()
removeListeners()
first, so any event history is lost.
This method is invoked during static section of this class.
addListeners(long)
,
removeListeners()
,
getTheWholeEventMask()
public static void removeListeners()
addListeners(long)
,
addListeners()
public static long getCurrentEventMask()
addListeners(long)
method.
In case if addListeners()
method was used last,
getTheWholeEventMask()
result is returned.
getTheWholeEventMask()
public static long getTheWholeEventMask()
AWTEvent.*_EVENT_MASK
fields..
AWTEvent.*_EVENT_MASK
fields.public void setTimeouts(Timeouts ts)
setTimeouts
in interface Timeoutable
ts
- ?t? A collection of timeout assignments.Timeouts
,
Timeoutable
,
getTimeouts()
public Timeouts getTimeouts()
getTimeouts
in interface Timeoutable
Timeouts
,
Timeoutable
,
setTimeouts(org.netbeans.jemmy.Timeouts)
public void setOutput(TestOut out)
setOutput
in interface Outputable
out
- Identify the streams or writers used for print output.Outputable
,
TestOut
,
getOutput()
public TestOut getOutput()
getOutput
in interface Outputable
Outputable
,
TestOut
,
setOutput(org.netbeans.jemmy.TestOut)
public AWTEvent waitEvent(long eventMask)
EventTool.WaitEventTimeout
milliseconds.
eventMask
- Mask to wait events under.
AWTEvent.*_EVENT_MASK
fields combination.
TimeoutExpiredException
waitEvent()
public AWTEvent waitEvent()
EventTool.WaitEventTimeout
milliseconds.
TimeoutExpiredException
waitEvent(long)
,
getTheWholeEventMask()
public boolean checkNoEvent(long eventMask, long waitTime)
eventMask
- Mask to wait events under.
AWTEvent.*_EVENT_MASK
fields combination.waitTime
- Quiet time (millisecons).
checkNoEvent(long)
public boolean checkNoEvent(long waitTime)
waitTime
- Quiet time (millisecons).
checkNoEvent(long, long)
,
getTheWholeEventMask()
public void waitNoEvent(long eventMask, long waitTime)
EventTool.WaitNoEventTimeout
time waits for
true result of checkNoEvent(long, long) method.
eventMask
- Mask to wait events under.
AWTEvent.*_EVENT_MASK
fields combination.waitTime
- Quiet time (millisecons).
TimeoutExpiredException
checkNoEvent(long, long)
,
waitNoEvent(long)
public void waitNoEvent(long waitTime)
EventTool.WaitNoEventTimeout
time waits for
true result of checkNoEvent(long)
method.
waitTime
- Quiet time (millisecons).
TimeoutExpiredException
checkNoEvent(long)
,
waitNoEvent(long, long)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |