Package com.diffplug.common.swt
Class SwtExec.Guarded
java.lang.Object
com.diffplug.common.rx.GuardedExecutor
com.diffplug.common.swt.SwtExec.Guarded
- All Implemented Interfaces:
RxSubscriber
,Executor
- Enclosing class:
- SwtExec
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));
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionSame asSwtExec.schedule(Runnable, long, TimeUnit)
but automatically cancels when the guard is disposed.scheduleAtFixedRate
(Runnable command, long initialDelay, long delay, TimeUnit unit) Same asSwtExec.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
but automatically cancels when the guard is disposed.scheduleWithFixedDelay
(Runnable command, long initialDelay, long delay, TimeUnit unit) Same asSwtExec.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
but automatically cancels when the guard is disposed.void
Runs the given runnable after the given delay iff the guard widget is not disposed.Methods inherited from class com.diffplug.common.rx.GuardedExecutor
execute, getDelegate, getGuard, subscribe, subscribe, subscribe, subscribe, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable, wrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.diffplug.common.rx.RxSubscriber
subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable
-
Method Details
-
timerExec
Runs the given runnable after the given delay iff the guard widget is not disposed. -
schedule
Same asSwtExec.schedule(Runnable, long, TimeUnit)
but automatically cancels when the guard is disposed. Identical behavior for `immediate()`, `async()`, etc. -
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) Same asSwtExec.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
but automatically cancels when the guard is disposed. Identical behavior for `immediate()`, `async()`, etc. -
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long delay, TimeUnit unit) Same asSwtExec.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
but automatically cancels when the guard is disposed. Identical behavior for `immediate()`, `async()`, etc.
-