public class SWTObservables extends Object
Constructor and Description |
---|
SWTObservables() |
Modifier and Type | Method and Description |
---|---|
static Realm |
getRealm(Display display)
Returns the realm representing the UI thread for the given display.
|
static ISWTObservableValue |
observeBackground(Control control)
Returns an observable value tracking the background color of the given
control
|
static ISWTObservableValue |
observeBounds(Control control)
Returns an observable value tracking the bounds of the given control.
|
static ISWTObservableValue |
observeDelayedValue(int delay,
ISWTObservableValue observable)
Returns an observable which delays notification of value change events
from
observable until delay milliseconds have
elapsed since the last change event, or until a FocusOut event is
received from the underlying widget (whichever happens first). |
static ISWTObservableValue |
observeEditable(Control control)
Returns an observable observing the editable attribute of the provided
control . |
static ISWTObservableValue |
observeEnabled(Control control)
Returns an observable value tracking the enabled state of the given
control
|
static ISWTObservableValue |
observeEnabled(Widget widget)
Returns an observable value tracking the enabled state of the given
widget.
|
static ISWTObservableValue |
observeFocus(Control control)
Returns an observable value tracking the focus of the given control.
|
static ISWTObservableValue |
observeFont(Control control)
Returns an observable value tracking the font of the given control.
|
static ISWTObservableValue |
observeForeground(Control control)
Returns an observable value tracking the foreground color of the given
control
|
static ISWTObservableValue |
observeImage(Widget widget)
Returns an observable observing the image attribute of the provided
widget . |
static IObservableList |
observeItems(Control control)
Returns an observable observing the items attribute of the provided
control . |
static ISWTObservableValue |
observeLocation(Control control)
Returns an observable value tracking the location of the given control.
|
static ISWTObservableValue |
observeMax(Control control)
Returns an observable observing the maximum attribute of the provided
control . |
static ISWTObservableValue |
observeMessage(Widget widget)
Returns an observable observing the message attribute of the provided
widget . the supported types are:
org.eclipse.swt.widgets.Text
org.eclipse.swt.widgets.ToolTip
|
static ISWTObservableValue |
observeMin(Control control)
Returns an observable observing the minimum attribute of the provided
control . |
static ISWTObservableValue |
observeSelection(Control control)
Returns an observable observing the selection attribute of the provided
control . |
static ISWTObservableValue |
observeSelection(Widget widget)
Returns an observable observing the selection attribute of the provided
control . |
static ISWTObservableValue |
observeSingleSelectionIndex(Control control)
Returns an observable observing the single selection index attribute of
the provided
control . |
static ISWTObservableValue |
observeSize(Control control)
Returns an observable value tracking the size of the given control.
|
static ISWTObservableValue |
observeText(Control control)
Returns an observable observing the text attribute of the provided
control . |
static ISWTObservableValue |
observeText(Control control,
int event)
Returns an observable observing the text attribute of the provided
control . |
static ISWTObservableValue |
observeText(Control control,
int[] events)
Returns an observable observing the text attribute of the provided
control . |
static ISWTObservableValue |
observeText(Widget widget)
Returns an observable observing the text attribute of the provided
widget . |
static ISWTObservableValue |
observeTooltipText(Control control)
Returns an observable value tracking the tooltip text of the given
control
|
static ISWTObservableValue |
observeTooltipText(Widget widget)
Returns an observable tracking the tooltip text of the given item.
|
static ISWTObservableValue |
observeVisible(Control control)
Returns an observable value tracking the visible state of the given
control
|
public static Realm getRealm(Display display)
display
- public static ISWTObservableValue observeDelayedValue(int delay, ISWTObservableValue observable)
observable
until delay
milliseconds have
elapsed since the last change event, or until a FocusOut event is
received from the underlying widget (whichever happens first). This
observable helps to boost performance in situations where an observable
has computationally expensive listeners (e.g. changing filters in a
viewer) or many dependencies (master fields with multiple detail fields).
A common use of this observable is to delay validation of user input
until the user stops typing in a UI field.
To notify about pending changes, the returned observable fires a stale
event when the wrapped observable value fires a change event, and remains
stale until the delay has elapsed and the value change is fired. A call
to getValue()
while a value change is
pending will fire the value change immediately, short-circuiting the
delay.
Note that this observable will not forward ValueChangingEvent
events from a wrapped IVetoableValue
.
delay
- the delay in millisecondsobservable
- the observable being delayedobservable
until delay
milliseconds have elapsed since the last change event.public static ISWTObservableValue observeEnabled(Widget widget)
widget
- public static ISWTObservableValue observeEnabled(Control control)
control
- the control to observepublic static ISWTObservableValue observeVisible(Control control)
control
- the control to observepublic static ISWTObservableValue observeTooltipText(Widget widget)
widget
- public static ISWTObservableValue observeTooltipText(Control control)
control
- the control to observepublic static ISWTObservableValue observeSelection(Widget widget)
control
. The supported types are:
widget
- IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeSelection(Control control)
control
. The supported types are:
control
- IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeMin(Control control)
control
. The supported types are:
control
- IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeMax(Control control)
control
. The supported types are:
control
- IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeText(Control control, int[] events)
control
. The supported types are:
control
- events
- array of SWT event types to register for change events. May
include SWT.None
, SWT.Modify
,
SWT.FocusOut
or SWT.DefaultSelection
.IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeText(Control control, int event)
control
. The supported types are:
control
- event
- event type to register for change eventsIllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeText(Widget widget)
widget
. The supported types are:
widget
- IllegalArgumentException
- if the type of widget
is unsupportedpublic static ISWTObservableValue observeText(Control control)
control
. The supported types are:
control
- IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeMessage(Widget widget)
widget
. the supported types are:
widget
- widget
.public static ISWTObservableValue observeImage(Widget widget)
widget
. The supported types are:
widget
- IllegalArgumentException
- if widget
type is unsupportedpublic static IObservableList observeItems(Control control)
control
. The supported types are:
control
- IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeSingleSelectionIndex(Control control)
control
. The supported types are:
control
- IllegalArgumentException
- if control
type is unsupportedpublic static ISWTObservableValue observeForeground(Control control)
control
- the control to observepublic static ISWTObservableValue observeBackground(Control control)
control
- the control to observepublic static ISWTObservableValue observeFont(Control control)
control
- the control to observepublic static ISWTObservableValue observeSize(Control control)
control
- the control to observepublic static ISWTObservableValue observeLocation(Control control)
control
- the control to observepublic static ISWTObservableValue observeFocus(Control control)
control
- the control to observepublic static ISWTObservableValue observeBounds(Control control)
control
- the control to observepublic static ISWTObservableValue observeEditable(Control control)
control
. The supported types are:
control
- IllegalArgumentException
- if control
type is unsupported
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.