public static class SwtExec.Guarded extends GuardedExecutor
Executor
and Rx
for conducting actions which are guarded on an SWT widget.
Obtained via SwtExec.guardOn(Widget)
or SwtExec.guardOn(ControlWrapper)
.
SwtExec.Guarded guarded = SwtExec.immediate().guardOn(textBox); // guaranteed to not cause "Widget is disposed" errors guarded.subscribe(serverResponse, txt -> textBox.setText(text));
Rx
Modifier and Type | Method and Description |
---|---|
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Same as
SwtExec.schedule(Runnable, long, TimeUnit) but automatically
cancels when the guard is disposed. |
ScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Same as
SwtExec.scheduleAtFixedRate(Runnable, long, long, TimeUnit) but automatically
cancels when the guard is disposed. |
ScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Same as
SwtExec.scheduleWithFixedDelay(Runnable, long, long, TimeUnit) but automatically
cancels when the guard is disposed. |
void |
timerExec(int delayMs,
Runnable runnable)
Runs the given runnable after the given delay iff the guard widget is not disposed.
|
execute, getDelegateRxExecutor, getGuard, subscribe, subscribe, subscribe, subscribeDisposable, subscribeDisposable, subscribeDisposable, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
subscribe, subscribe, subscribe, subscribe, subscribe, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable
public void timerExec(int delayMs, Runnable runnable)
Runs the given runnable after the given delay iff the guard widget is not disposed.
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
Same as SwtExec.schedule(Runnable, long, TimeUnit)
but automatically
cancels when the guard is disposed. Identical behavior for immediate()
,
async()
, etc.
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
Same as SwtExec.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
but automatically
cancels when the guard is disposed. Identical behavior for immediate()
,
async()
, etc.
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long delay, TimeUnit unit)
Same as SwtExec.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
but automatically
cancels when the guard is disposed. Identical behavior for immediate()
,
async()
, etc.