Package org.fest.swing.edt
Class GuiActionRunner
java.lang.Object
org.fest.swing.edt.GuiActionRunner
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Executes the given query in the event dispatch thread.static void
Executes the given task in the event dispatch thread.private static <T> T
executeInCurrentThread
(GuiQuery<T> query) private static void
static boolean
static void
executeInEDT
(boolean b) Indicates
if instances ofGuiActionRunner
andGuiQuery
should be executed in the event dispatch thread or not.GuiTask
private static <T> T
private static void
rethrowCatchedExceptionIn
(GuiAction action) Wraps (with a
) and retrows any catched exception in the given action.UnexpectedException
private static void
-
Field Details
-
executeInEDT
private static boolean executeInEDT
-
-
Constructor Details
-
GuiActionRunner
public GuiActionRunner()
-
-
Method Details
-
executeInEDT
public static void executeInEDT(boolean b) Indicates
if instances ofGuiActionRunner
andGuiQuery
should be executed in the event dispatch thread or not.GuiTask
- Parameters:
b
- iftrue
, GUI actions are executed in the event dispatch thread. Iffalse
, GUI actions are executed in the current thread.
-
executeInEDT
public static boolean executeInEDT()Returns whether instances of
andGuiQuery
should be executed in the event dispatch thread or not.GuiTask
- Returns:
true
if GUI actions are executed in the event dispatch thread,false
otherwise.
-
execute
Executes the given query in the event dispatch thread. This method waits until the query has finished its execution.- Type Parameters:
T
- the generic type of the return value.- Parameters:
query
- the query to execute.- Returns:
- the result of the query executed in the main thread.
- Throws:
UnexpectedException
- wrapping any checked exception thrown when executing the given query in the event dispatch thread. Unchecked exceptions are re-thrown without any wrapping.- See Also:
-
executeInCurrentThread
-
execute
Executes the given task in the event dispatch thread. This method waits until the task has finished its execution.- Parameters:
task
- the task to execute.- Throws:
UnexpectedException
- wrapping any checked exception thrown when executing the given query in the event dispatch thread. Unchecked exceptions are re-thrown without any wrapping.- See Also:
-
executeInCurrentThread
-
run
-
resultOf
-
rethrowCatchedExceptionIn
Wraps (with a
) and retrows any catched exception in the given action.UnexpectedException
- Parameters:
action
- the given action that may have a catched exception during its execution.- Throws:
UnexpectedException
- wrapping any checked exception thrown when executing the given query in the event dispatch thread. Unchecked exceptions are rethrown without any wrapping.
-