|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.jemmy.QueueTool
public class QueueTool
Provides functionality to work with java.awt.EventQueue empty.
Timeouts used:
QueueTool.WaitQueueEmptyTimeout - timeout to wait queue emptied
QueueTool.QueueCheckingDelta - time delta to check result
QueueTool.LockTimeout - time to wait queue locked after lock action has been put there
QueueTool.InvocationTimeout - time for action was put into queue to be started
QueueTool.MaximumLockingTime - maximum time to lock queue.
Timeouts
Nested Class Summary | |
---|---|
static class |
QueueTool.QueueAction
Action to be excuted through event queue. |
Constructor Summary | |
---|---|
QueueTool()
Constructor. |
Method Summary | |
---|---|
TestOut |
getOutput()
Returns print output streams or writers. |
static java.awt.EventQueue |
getQueue()
Returns system EventQueue. |
Timeouts |
getTimeouts()
Return current timeouts. |
static boolean |
checkEmpty()
Checks if system event queue is empty. |
static void |
installQueue()
Installs own Jemmy EventQueue implementation. |
QueueTool.QueueAction |
invoke(Action action,
java.lang.Object param)
Invokes action through EventQueue. |
void |
invoke(QueueTool.QueueAction action)
Invokes action through EventQueue. |
QueueTool.QueueAction |
invoke(java.lang.Runnable runnable)
Invokes runnable through EventQueue. |
java.lang.Object |
invokeAndWait(Action action,
java.lang.Object param)
Invokes action through EventQueue. |
java.lang.Object |
invokeAndWait(QueueTool.QueueAction action)
Invokes action through EventQueue. |
void |
invokeAndWait(java.lang.Runnable runnable)
Invokes runnable through EventQueue. |
java.lang.Object |
invokeSmoothly(Action action,
java.lang.Object param)
Being executed outside of AWT dispatching thread, invokes an action through the event queue. |
java.lang.Object |
invokeSmoothly(QueueTool.QueueAction action)
Being executed outside of AWT dispatching thread, invokes an action through the event queue. |
void |
invokeSmoothly(java.lang.Runnable runnable)
Being executed outside of AWT dispatching thread, invokes a runnable through the event queue. |
static boolean |
isDispatchThread()
Map to EventQueue.isDispatchThread() . |
void |
lock()
Locks EventQueue. |
void |
lock(long time)
Locks event queue for "time" milliseconds. |
static void |
postEvent(java.awt.AWTEvent event)
Simply posts events into the system event queue. |
static void |
processEvent(java.awt.AWTEvent event)
Shortcuts event if ((JemmyProperties.getCurrentDispatchingModel() & JemmyProperties.SHORTCUT_MODEL_MASK) ! |
void |
setOutput(TestOut out)
Defines print output streams or writers. |
void |
setTimeouts(Timeouts ts)
Defines current timeouts. |
static void |
shortcutEvent(java.awt.AWTEvent event)
Dispatches event ahead of all events staying in the event queue. |
static void |
uninstallQueue()
Uninstalls own Jemmy EventQueue implementation. |
void |
unlock()
Unlocks EventQueue. |
void |
waitEmpty()
Waits for system event queue empty. |
void |
waitEmpty(long emptyTime)
Waits for system event queue be empty for emptyTime milliseconds. |
boolean |
wasLockingExpired()
Sais if last locking was expired. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueueTool()
Method Detail |
---|
public static java.awt.EventQueue getQueue()
public static boolean isDispatchThread()
EventQueue.isDispatchThread()
.
public static boolean checkEmpty()
public static void processEvent(java.awt.AWTEvent event)
((JemmyProperties.getCurrentDispatchingModel() & JemmyProperties.SHORTCUT_MODEL_MASK) != 0)
and if executed in the dispatch thread.
Otherwise posts event.
event
- Event to dispatch.public static void postEvent(java.awt.AWTEvent event)
event
- Event to dispatch.public static void shortcutEvent(java.awt.AWTEvent event)
event
- an event to be shortcut.public static void installQueue()
uninstallQueue()
public static void uninstallQueue()
installQueue()
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 void waitEmpty()
TimeoutExpiredException
public void waitEmpty(long emptyTime)
emptyTime
milliseconds.
Uses "QueueTool.WaitQueueEmptyTimeout" milliseconds to wait.
emptyTime
- time for the queue to stay empty.
TimeoutExpiredException
public void invoke(QueueTool.QueueAction action)
action
- an action to be invoked.public QueueTool.QueueAction invoke(java.lang.Runnable runnable)
runnable
- a runnable to be invoked.
QueueTool.QueueAction
public QueueTool.QueueAction invoke(Action action, java.lang.Object param)
action
- an action to be invoked.param
- action.launch(Object)
method parameter.
QueueTool.QueueAction
public java.lang.Object invokeSmoothly(QueueTool.QueueAction action)
action.launch()
method
directly.
action
- anaction to be executed.
public void invokeSmoothly(java.lang.Runnable runnable)
runnable.run()
method
directly.
runnable
- a runnable to be executed.public java.lang.Object invokeSmoothly(Action action, java.lang.Object param)
action.launch(Object)
method
directly.
action
- anaction to be executed.param
- an action parameter
public java.lang.Object invokeAndWait(QueueTool.QueueAction action)
action
- an action to be invoked.
TimeoutExpiredException
- if action
was not executed in "QueueTool.InvocationTimeout" milliseconds.public void invokeAndWait(java.lang.Runnable runnable)
runnable
- a runnable to be invoked.
TimeoutExpiredException
- if runnable
was not executed in "QueueTool.InvocationTimeout" milliseconds.public java.lang.Object invokeAndWait(Action action, java.lang.Object param)
action
- an action to be invoked.param
- action.launch(Object method parameter.
TimeoutExpiredException
- if action
was not executed in "QueueTool.InvocationTimeout" milliseconds.public void lock()
TimeoutExpiredException
unlock()
public void unlock()
lock()
public void lock(long time)
time
- a time to lock the queue for.public boolean wasLockingExpired()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |