public class RunnableManager extends Object
Runnable
, i.e. frequent calls of the executeAsync(Runnable)
with long running Runnable
s will not result in each Runnable
being called.
This is useful, for instance, if the same Runnable
is
submitted multiple times unnecessarily.Constructor and Description |
---|
RunnableManager(org.eclipse.swt.widgets.Display display)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
executeAsync(Runnable runnable)
Execute the given
Runnable via Display.asyncExec(Runnable) . |
org.eclipse.swt.widgets.Display |
getDisplay() |
boolean |
isRunning()
Query whether a runnable is in progress (asynchronously) on the display thread.
|
public RunnableManager(org.eclipse.swt.widgets.Display display)
display
- the Display
that is used to submit a runnablepublic void executeAsync(Runnable runnable)
Runnable
via Display.asyncExec(Runnable)
.runnable
- the Runnable
to be executed asynchronouslypublic org.eclipse.swt.widgets.Display getDisplay()
public boolean isRunning()
true
if a runnable is currently running on the display thread
or waiting to run on the display thread; false
, otherwiseCopyright © 2019. All rights reserved.