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> TExecutes the given query in the event dispatch thread.static voidExecutes the given task in the event dispatch thread.private static <T> TexecuteInCurrentThread(GuiQuery<T> query) private static voidstatic booleanstatic voidexecuteInEDT(boolean b) Indicatesif instances ofGuiActionRunnerandGuiQueryshould be executed in the event dispatch thread or not.GuiTaskprivate static <T> Tprivate static voidrethrowCatchedExceptionIn(GuiAction action) Wraps (with a) and retrows any catched exception in the given action.UnexpectedExceptionprivate static void
-
Field Details
-
executeInEDT
private static boolean executeInEDT
-
-
Constructor Details
-
GuiActionRunner
public GuiActionRunner()
-
-
Method Details
-
executeInEDT
public static void executeInEDT(boolean b) Indicatesif instances ofGuiActionRunnerandGuiQueryshould 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 ofandGuiQueryshould be executed in the event dispatch thread or not.GuiTask- Returns:
trueif GUI actions are executed in the event dispatch thread,falseotherwise.
-
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.
-