public final class SwingObservables
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
create(java.lang.Class<T> listener,
Observer<? super Dynamic> bindTo)
Create a dynamic observer for the given listener interface by
proxying all method calls.
|
static Scheduler |
getDefaultEdtScheduler() |
static <T> Observable<T> |
observeOnEdt(Observable<T> observable)
Wrap the observable to the Event Dispatch Thread for listening to events.
|
static Scheduler |
replaceDefaultEdtScheduler(Scheduler newScheduler)
Replace the current default scheduler with the specified new scheduler.
|
static void |
restoreDefaultEdtScheduler()
Restore the default scheduler back to the
DefaultScheduler
used when this class was initialized. |
static <T> Observable<T> |
subscribeOnEdt(Observable<T> observable)
Wrap the observable to the Event Dispatch Thread for subscribing to events.
|
@Nonnull
public static <T> T create(@Nonnull
java.lang.Class<T> listener,
@Nonnull
Observer<? super Dynamic> bindTo)
void, return Void (or the original call site should accept nulls).
Note that due this proxying effect, the handler invocation may be 100 times slower than a direct implementationT - the listener interface typelistener - the list interface classbindTo - the target observer, use the DefaultObservable@Nonnull public static <T> Observable<T> observeOnEdt(@Nonnull Observable<T> observable)
T - the value type to observeobservable - the original observable@Nonnull public static Scheduler getDefaultEdtScheduler()
@Nonnull public static Scheduler replaceDefaultEdtScheduler(@Nonnull Scheduler newScheduler)
newScheduler - the new schedulerpublic static void restoreDefaultEdtScheduler()
DefaultScheduler
used when this class was initialized.@Nonnull public static <T> Observable<T> subscribeOnEdt(Observable<T> observable)
T - the value type to observeobservable - the original observable