| java.lang.Object org.eclipse.ui.tests.navigator.DisplayHelper
DisplayHelper | abstract public class DisplayHelper (Code) | | Runs the event loop of the given display until
DisplayHelper.condition() becomes
true or no events have occurred for the supplied timeout.
Between running the event loop,
Display.sleep is called.
There is a caveat: the given timeouts must be long enough that the calling
thread can enter Display.sleep() before the timeout elapses,
otherwise, the waiter may time out before sleep is called and
the sleeping thread may never be waken up.
since: 3.1 |
Constructor Summary | |
protected | DisplayHelper() Creates a new instance. |
Method Summary | |
abstract protected boolean | condition() The condition which has to be met in order for
DisplayHelper.waitForCondition(Display,int) to return before the timeout
elapses. | public static boolean | runEventLoop(Display display, long timeout) Call
Display.sleep and run the event loop once if
sleep returns before the timeout elapses. | public static void | sleep(Display display, long millis) Call
Display.sleep and run the event loop until the given
timeout has elapsed.
If timeout < 0 , nothing happens. | final public boolean | waitForCondition(Display display, long timeout) Until
DisplayHelper.condition() becomes true or the timeout
elapses, call
Display.sleep and run the event loop.
If timeout < 0 , the event loop is never driven and
only the condition is checked. | final public boolean | waitForCondition(Display display, long timeout, long interval) Until
DisplayHelper.condition() becomes true or the timeout
elapses, call
Display.sleep and run the event loop.
If timeout < 0 , the event loop is never driven and
only the condition is checked. |
DisplayHelper | protected DisplayHelper()(Code) | | Creates a new instance.
|
condition | abstract protected boolean condition()(Code) | | The condition which has to be met in order for
DisplayHelper.waitForCondition(Display,int) to return before the timeout
elapses.
true if the condition is met, false if the event loop should be driven some more |
runEventLoop | public static boolean runEventLoop(Display display, long timeout)(Code) | | Call
Display.sleep and run the event loop once if
sleep returns before the timeout elapses. Returns
true if any events were processed, false if
not.
If timeout < 0 , nothing happens and false is returned.
If timeout == 0 , the event loop is driven exactly once,
but Display.sleep() is never invoked.
Parameters: display - the display to run the event loop of Parameters: timeout - the timeout in milliseconds true if any event was taken off the event queue,false if not |
sleep | public static void sleep(Display display, long millis)(Code) | | Call
Display.sleep and run the event loop until the given
timeout has elapsed.
If timeout < 0 , nothing happens. If
timeout == 0 , the event loop is driven exactly once, but
Display.sleep() is never invoked.
Parameters: display - the display to run the event loop of Parameters: millis - the timeout in milliseconds |
waitForCondition | final public boolean waitForCondition(Display display, long timeout)(Code) | | Until
DisplayHelper.condition() becomes true or the timeout
elapses, call
Display.sleep and run the event loop.
If timeout < 0 , the event loop is never driven and
only the condition is checked. If timeout == 0 , the event
loop is driven at most once, but Display.sleep() is never
invoked.
Parameters: display - the display to run the event loop of Parameters: timeout - the timeout in milliseconds true if the condition became true ,false if the timeout elapsed |
waitForCondition | final public boolean waitForCondition(Display display, long timeout, long interval)(Code) | | Until
DisplayHelper.condition() becomes true or the timeout
elapses, call
Display.sleep and run the event loop.
If timeout < 0 , the event loop is never driven and
only the condition is checked. If timeout == 0 , the event
loop is driven at most once, but Display.sleep() is never
invoked.
The condition gets rechecked every interval milliseconds, even
if no events were read from the queue.
Parameters: display - the display to run the event loop of Parameters: timeout - the timeout in milliseconds Parameters: interval - the interval to re-check the condition in milliseconds true if the condition became true ,false if the timeout elapsed |
|
|