public static class SwtExec.Guarded extends Object implements Executor, RxSubscriber
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 |
---|---|
void |
execute(Runnable runnable)
Runs the given runnable iff the guard widget is not disposed.
|
Widget |
getGuard()
Returns the guard widget.
|
<T> Subscription |
subscribe(CompletionStage<? extends T> future,
RxListener<T> listener) |
<T> Subscription |
subscribe(ListenableFuture<? extends T> future,
RxListener<T> listener) |
<T> Subscription |
subscribe(Observable<? extends T> observable,
RxListener<T> listener) |
void |
timerExec(int delayMs,
Runnable runnable)
Runs the given runnable after the given delay iff the guard widget is not disposed.
|
Runnable |
wrap(Runnable runnable)
Creates a runnable which runs on this Executor iff the guard widget is not disposed.
|
public Widget getGuard()
public Runnable wrap(Runnable runnable)
public void execute(Runnable runnable)
public void timerExec(int delayMs, Runnable runnable)
public <T> Subscription subscribe(Observable<? extends T> observable, RxListener<T> listener)
subscribe
in interface RxSubscriber
public <T> Subscription subscribe(ListenableFuture<? extends T> future, RxListener<T> listener)
subscribe
in interface RxSubscriber
public <T> Subscription subscribe(CompletionStage<? extends T> future, RxListener<T> listener)
subscribe
in interface RxSubscriber