|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sdm.quasar.client.swing.common.event.SwingEventDispatchThreadUtilities
A utility class to run ExceptionRunnables
or Runnables in- our outside the event dispatch thread.
Note: runNotInEventDispatchThread(com.sdm.quasar.client.core.common.event.ExceptionRunnable) uses thread pooling via
com.dcag.s55.gool.core.event.ThreadPool#run(Runnable) using the global thread pool
accessible via com.dcag.s55.gool.core.event.ThreadPool#getGlobalThreadPool(), which
might be configured to match application needs.
| Method Summary | |
static boolean |
isEventDispatchThread()
Returns true if the current thread is an AWT event
dispatching thread. |
static java.lang.Object |
runInEventDispatchThread(ExceptionRunnable runnable)
Runs the given ExceptionRunnable in the event dispatch
thread. |
static void |
runInEventDispatchThread(java.lang.Runnable runnable)
Runs the given Runnable in the event dispatch thread. |
static void |
runLaterInEventDispatchThread(java.lang.Runnable runnable)
Causes runnable to have its run() method called in the event dispatch thread. |
static java.lang.Object |
runNotInEventDispatchThread(ExceptionRunnable runnable)
Runs the given ExceptionRunnable not in the event dispatch
thread. |
static java.lang.Object |
runNotInEventDispatchThread(ExceptionRunnable runnable,
boolean block_input_events)
Runs the given ExceptionRunnable not in the event dispatch
thread. |
static void |
runNotInEventDispatchThread(java.lang.Runnable runnable)
Runs the given Runnable not in the event dispatch thread. |
static void |
runNotInEventDispatchThread(java.lang.Runnable runnable,
boolean block_input_events)
Runs the given Runnable not in the event dispatch thread. |
static void |
runOrRunLaterInEventDispatchThread(java.lang.Runnable runnable)
Causes runnable to have its run() method called in the dispatch thread of the EventQueue. |
static void |
waitForCondition(Condition condition)
Waits for the condition given without blocking event processing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.lang.Object runNotInEventDispatchThread(ExceptionRunnable runnable)
throws java.lang.Exception
ExceptionRunnable not in the event dispatch
thread.
runnable - the ExceptionRunnable to run
ExceptionRunnable.run()
java.lang.InterruptedException - if the executing thread was interrupted
java.lang.Exception - any exception thrown by the ExceptionRunnable
public static java.lang.Object runNotInEventDispatchThread(ExceptionRunnable runnable,
boolean block_input_events)
throws java.lang.Exception
ExceptionRunnable not in the event dispatch
thread.
runnable - the ExceptionRunnable to runblock_input_events - if true, any input event will be
blocked as long as the operation runs. This forbids user interaction while
exceuting the runnable but allows invokeLater and paint events etc. Set
to false to make no restrictions on the events processed
while running the operation.
ExceptionRunnable.run()
java.lang.InterruptedException - if the executing thread was interrupted
java.lang.Exception - any exception thrown by the ExceptionRunnablepublic static void runNotInEventDispatchThread(java.lang.Runnable runnable)
Runnable not in the event dispatch thread.
runnable - the Runnable to run
WrappedCheckedException - if a InterruptedException occured
public static void runNotInEventDispatchThread(java.lang.Runnable runnable,
boolean block_input_events)
Runnable not in the event dispatch thread.
runnable - the Runnable to runblock_input_events - if true, any input event will be
blocked as long as the operation runs. This forbids user interaction while
exceuting the runnable but allows invokeLater and paint events etc. Set
to false to make no restrictions on the events processed
while running the operation.
WrappedCheckedException - if a InterruptedException occured
public static java.lang.Object runInEventDispatchThread(ExceptionRunnable runnable)
throws java.lang.InterruptedException,
java.lang.Exception
ExceptionRunnable in the event dispatch
thread.
runnable - the ExceptionRunnable to run
ExceptionRunnable.run()
java.lang.InterruptedException - if the executing thread was interrupted
java.lang.Exception - any exception thrown by the ExceptionRunnablepublic static void runInEventDispatchThread(java.lang.Runnable runnable)
Runnable in the event dispatch thread.
runnable - the Runnable to run
WrappedCheckedException - if a InterruptedException occuredpublic static boolean isEventDispatchThread()
true if the current thread is an AWT event
dispatching thread.
public static void runLaterInEventDispatchThread(java.lang.Runnable runnable)
runnable - the Runnable whose run() method should be executed
synchronously on the event queuepublic static void runOrRunLaterInEventDispatchThread(java.lang.Runnable runnable)
Note: This method may or may not return before the runnable gets
executed within the EDT. In opposite to #invokeLater(Runnable) it
calls the runnable faster (immediately), if called within the EDT.
runnable - the Runnable whose run() method should be executed
synchronously on the EventQueue#invokeLater(Runnable)
public static void waitForCondition(Condition condition)
throws java.lang.InterruptedException
Note: Implementation might wait on the object given.
condition - the Condition to wait for (until Condition.isFulfilled()
returns true)
java.lang.InterruptedException - if waiting was interrupted
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||