|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgriffon.core.UIThreadManager
public final class UIThreadManager extends Object
Helper class that can execute code inside the UI thread.
Nested Class Summary | |
---|---|
private static class |
UIThreadManager.ScriptOrRunnableRunner
|
Field Summary | |
---|---|
private static ExecutorService |
DEFAULT_EXECUTOR_SERVICE
|
private static String |
EXECUTE_FUTURE
|
private static CallableWithArgsClosure |
EXECUTE_FUTURE_RUNNER
|
private static String |
EXECUTE_INSIDE_UI_ASYNC
|
private static RunnableWithArgsClosure |
EXECUTE_INSIDE_UI_ASYNC_RUNNER
|
private static String |
EXECUTE_INSIDE_UI_SYNC
|
private static RunnableWithArgsClosure |
EXECUTE_INSIDE_UI_SYNC_RUNNER
|
private static String |
EXECUTE_OUTSIDE_UI
|
private static RunnableWithArgsClosure |
EXECUTE_OUTSIDE_UI_RUNNER
|
private static UIThreadManager |
INSTANCE
|
private static String |
IS_UITHREAD
|
private static CallableWithArgsClosure |
IS_UITHREAD_RUNNER
|
private static org.slf4j.Logger |
LOG
|
private UIThreadHandler |
uiThreadHandler
|
Constructor Summary | |
private UIThreadManager()
|
Method Summary | |
---|---|
static void
|
enhance(Script script)
|
static void
|
enhance(MetaClass metaClass)
|
void
|
executeAsync(Runnable runnable)
Executes a code block asynchronously on the UI thread. |
void
|
executeAsync(Script script)
Executes a code block asynchronously on the UI thread. |
Future
|
executeFuture(Callable callable)
Executes a code block as a Future on an ExecutorService. |
Future
|
executeFuture(ExecutorService executorService, Callable callable)
Executes a code block as a Future on an ExecutorService. |
void
|
executeOutside(Runnable runnable)
Executes a code block outside of the UI thread. |
void
|
executeOutside(Script script)
Executes a code block outside of the UI thread. |
void
|
executeSync(Runnable runnable)
Executes a code block synchronously on the UI thread. |
void
|
executeSync(Script script)
Executes a code block synchronously on the UI thread. |
static UIThreadManager
|
getInstance()
|
UIThreadHandler
|
getUIThreadHandler()
|
boolean
|
isUIThread()
True if the current thread is the UI thread. |
void
|
setUIThreadHandler(UIThreadHandler threadHandler)
|
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
private static final ExecutorService DEFAULT_EXECUTOR_SERVICE
private static final String EXECUTE_FUTURE
private static final CallableWithArgsClosure EXECUTE_FUTURE_RUNNER
private static final String EXECUTE_INSIDE_UI_ASYNC
private static final RunnableWithArgsClosure EXECUTE_INSIDE_UI_ASYNC_RUNNER
private static final String EXECUTE_INSIDE_UI_SYNC
private static final RunnableWithArgsClosure EXECUTE_INSIDE_UI_SYNC_RUNNER
private static final String EXECUTE_OUTSIDE_UI
private static final RunnableWithArgsClosure EXECUTE_OUTSIDE_UI_RUNNER
private static final UIThreadManager INSTANCE
private static final String IS_UITHREAD
private static final CallableWithArgsClosure IS_UITHREAD_RUNNER
private static final org.slf4j.Logger LOG
private UIThreadHandler uiThreadHandler
Constructor Detail |
---|
private UIThreadManager()
Method Detail |
---|
public static void enhance(Script script)
public static void enhance(MetaClass metaClass)
public void executeAsync(Runnable runnable)
runnable
- a code block to be executed
public void executeAsync(Script script)
script
- a code block to be executed
public Future executeFuture(Callable callable)
callable
- a code block to be executed
public Future executeFuture(ExecutorService executorService, Callable callable)
executorService
- the ExecutorService to use. Will use the default ExecutorService if null.callable
- a code block to be executed
public void executeOutside(Runnable runnable)
runnable
- a code block to be executed
public void executeOutside(Script script)
script
- a code block to be executed
public void executeSync(Runnable runnable)
runnable
- a code block to be executed
public void executeSync(Script script)
script
- a code block to be executed
public static UIThreadManager getInstance()
public UIThreadHandler getUIThreadHandler()
public boolean isUIThread()
public void setUIThreadHandler(UIThreadHandler threadHandler)
Groovy Documentation