|
Griffon 1.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgriffon.core.UIThreadManager
public final class UIThreadManager
Helper class that can execute code inside the UI thread.
Nested Class Summary | |
---|---|
private static class |
UIThreadManager.RunnableRunner
|
Constructor Summary | |
private UIThreadManager()
|
Method Summary | |
---|---|
static void
|
enhance(Script script)
|
static void
|
enhance(MetaClass mc)
|
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 Closure EXECUTE_FUTURE_CLOSURE
private static final MetaMethod EXECUTE_FUTURE_METHOD1
private static final MetaMethod EXECUTE_FUTURE_METHOD2
private static final String EXECUTE_INSIDE_UI_ASYNC
private static final Closure EXECUTE_INSIDE_UI_ASYNC_CLOSURE
private static final MetaMethod EXECUTE_INSIDE_UI_ASYNC_METHOD
private static final RunnableWithArgs EXECUTE_INSIDE_UI_ASYNC_RUNNER
private static final String EXECUTE_INSIDE_UI_SYNC
private static final Closure EXECUTE_INSIDE_UI_SYNC_CLOSURE
private static final MetaMethod EXECUTE_INSIDE_UI_SYNC_METHOD
private static final RunnableWithArgs EXECUTE_INSIDE_UI_SYNC_RUNNER
private static final String EXECUTE_OUTSIDE_UI
private static final Closure EXECUTE_OUTSIDE_UI_CLOSURE
private static final MetaMethod EXECUTE_OUTSIDE_UI_METHOD
private static final RunnableWithArgs EXECUTE_OUTSIDE_UI_RUNNER
private static Class[] EXEC_METHOD_ARGS
private static final UIThreadManager INSTANCE
private static final String IS_UITHREAD
private static final CallableWithArgs IS_UITHREAD_CALLABLE
private static final Closure IS_UITHREAD_CLOSURE
private static final MetaMethod IS_UITHREAD_METHOD
private static final Logger LOG
public static final String[] THREADING_METHOD_NAMES
private UIThreadHandler uiThreadHandler
Constructor Detail |
---|
private UIThreadManager()
Method Detail |
---|
public static void enhance(Script script)
public static void enhance(MetaClass mc)
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