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
public static class SwtExec.Guarded extends GuardedExecutor
Executor
andRx
for conducting actions which are guarded on an SWT widget. Obtained viaSwtExec.guardOn(Widget)
orSwtExec.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:
Rx
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScheduledFuture<?>
schedule(Runnable command, long delay, TimeUnit unit)
Same asSwtExec.schedule(Runnable, long, TimeUnit)
but automatically cancels when the guard is disposed.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.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.void
timerExec(int delayMs, Runnable runnable)
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, getDelegateRxExecutor, getGuard, subscribe, subscribe, subscribe, 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, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable, subscribeDisposable
-
-
-
-
Method Detail
-
timerExec
public void timerExec(int delayMs, Runnable runnable)
Runs the given runnable after the given delay iff the guard widget is not disposed.
-
schedule
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
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.
-
-