public class SwtRx extends Object
Constructor and Description |
---|
SwtRx() |
Modifier and Type | Method and Description |
---|---|
static Observable<Event> |
addListener(Widget widget,
Collection<Integer> events)
Subscribes to the given widget and pipes the events to an
Observable <Event >. |
static Observable<Event> |
addListener(Widget widget,
int... events)
Subscribes to the given widget and pipes the events to an
Observable <Event >. |
static Observable<Event> |
addListener(Widget widget,
Stream<Integer> events)
Subscribes to the given widget and pipes the events to an
Observable <Event >. |
static com.diffplug.common.rx.Chit |
chit(ControlWrapper wrapper)
Wraps the given
ControlWrapper in an Chit . |
static com.diffplug.common.rx.Chit |
chit(Widget guard)
Wraps the given
Widget in an Chit . |
static <T> com.diffplug.common.rx.RxBox<T> |
combo(Combo combo,
ImmutableList<T> values,
Function<T,String> converter)
Populates a Combo returns an `RxBox
|
static <T> void |
combo(Combo combo,
ImmutableList<T> values,
Function<T,String> converter,
com.diffplug.common.rx.RxBox<T> box)
Populates a Combo and bidirectionally binds it to an `RxBox
|
static Observable<Point> |
rightClickGlobal(Control ctl)
Returns an
Observable <Point > of the right-click mouse-up on the given control, in global coordinates. |
static Observable<Point> |
rightClickLocal(Control ctl)
Returns an
Observable <Point > of the right-click mouse-up on the given control, in local coordinates. |
static com.diffplug.common.rx.RxBox<String> |
textConfirmed(Text text)
Returns an RxBox
|
static com.diffplug.common.rx.RxBox<String> |
textImmediate(Text text)
Returns an RxBox
|
static com.diffplug.common.rx.RxBox<Boolean> |
toggle(Button btn)
Returns an `RxBox
|
public static Observable<Event> addListener(Widget widget, int... events)
Observable
<Event
>.public static Observable<Event> addListener(Widget widget, Collection<Integer> events)
Observable
<Event
>.public static Observable<Event> addListener(Widget widget, Stream<Integer> events)
Observable
<Event
>.public static Observable<Point> rightClickGlobal(Control ctl)
Observable
<Point
> of the right-click mouse-up on the given control, in global coordinates.public static Observable<Point> rightClickLocal(Control ctl)
Observable
<Point
> of the right-click mouse-up on the given control, in local coordinates.public static com.diffplug.common.rx.RxBox<String> textImmediate(Text text)
public static com.diffplug.common.rx.RxBox<String> textConfirmed(Text text)
public static com.diffplug.common.rx.RxBox<Boolean> toggle(Button btn)
Applicable to SWT.TOGGLE, SWT.CHECK, and SWT.RADIO.
public static <T> com.diffplug.common.rx.RxBox<T> combo(Combo combo, ImmutableList<T> values, Function<T,String> converter)
combo
- The combo which is being bound.values
- The values which the RxBox can take on. Must match combo.getItems().public static <T> void combo(Combo combo, ImmutableList<T> values, Function<T,String> converter, com.diffplug.common.rx.RxBox<T> box)
combo
- The combo which is being bound.values
- The values which the RxBox can take on.converter
- A function for mapping values to strings.values
- The values which the RxBox can take on.public static com.diffplug.common.rx.Chit chit(ControlWrapper wrapper)
ControlWrapper
in an Chit
.