public class Observables extends Object
Observables
.Constructor and Description |
---|
Observables() |
Modifier and Type | Method and Description |
---|---|
static IObservableValue |
constantObservableValue(Object value)
Returns an observable value with the given constant value.
|
static IObservableValue |
constantObservableValue(Object value,
Object valueType)
Returns an observable value with the given constant value.
|
static IObservableValue |
constantObservableValue(Realm realm,
Object value)
Returns an observable value with the given constant value.
|
static IObservableValue |
constantObservableValue(Realm realm,
Object value,
Object valueType)
Returns an observable value with the given constant value.
|
static IObservableList |
emptyObservableList()
Returns an empty observable list.
|
static IObservableList |
emptyObservableList(Object elementType)
Returns an empty observable list of the given element type.
|
static IObservableList |
emptyObservableList(Realm realm)
Returns an empty observable list belonging to the given realm.
|
static IObservableList |
emptyObservableList(Realm realm,
Object elementType)
Returns an empty observable list of the given element type and belonging
to the given realm.
|
static IObservableSet |
emptyObservableSet()
Returns an empty observable set.
|
static IObservableSet |
emptyObservableSet(Object elementType)
Returns an empty observable set of the given element type.
|
static IObservableSet |
emptyObservableSet(Realm realm)
Returns an empty observable set belonging to the given realm.
|
static IObservableSet |
emptyObservableSet(Realm realm,
Object elementType)
Returns an empty observable set of the given element type and belonging
to the given realm.
|
static IObservableFactory |
mapEntryValueFactory(IObservableMap map,
Object valueType)
Returns a factory for creating obervable values tracking the value of the
observable map entry identified by a particular
key. |
static IObservableValue |
observeDelayedValue(int delay,
IObservableValue observable)
Returns an observable which delays notification of value change events
from
observable until delay milliseconds have
elapsed since the last change event. |
static IObservableValue |
observeDetailMapEntry(IObservableMap map,
IObservableValue master,
Object valueType)
Helper method for
MasterDetailObservables.detailValue(master,
mapEntryValueFactory(map, valueType), valueType) . |
static IObservableValue |
observeMapEntry(IObservableMap map,
Object key)
Returns an observable value that tracks changes to the value of an
observable map's entry specified by its key.
|
static IObservableValue |
observeMapEntry(IObservableMap map,
Object key,
Object valueType)
Returns an observable value that tracks changes to the value of an
observable map's entry specified by its key.
|
static IObservableValue |
observeStale(IObservable observable)
Returns an observable value of type
Boolean.TYPE which
tracks whether the given observable is stale. |
static void |
pipe(IObservableValue source,
IObservableValue destination)
Copies the current value of the source observable to the destination
observable, and upon value change events fired by the source observable,
updates the destination observable accordingly, until the source
observable is disposed.
|
static IObservableList |
proxyObservableList(IObservableList target)
Returns an observable list that contains the same elements as the given
list, and fires the same events as the given list, but can be disposed of
without disposing of the wrapped list.
|
static IObservableMap |
proxyObservableMap(IObservableMap target)
Returns an observable map that contains the same entries as the given
map, and fires the same events as the given map, but can be disposed of
without disposing of the wrapped map.
|
static IObservableSet |
proxyObservableSet(IObservableSet target)
Returns an observable set that contains the same elements as the given
set, and fires the same events as the given set, but can be disposed of
without disposing of the wrapped set.
|
static IObservableValue |
proxyObservableValue(IObservableValue target)
Returns an observable value that contains the same value as the given
observable, and fires the same events as the given observable, but can be
disposed of without disposing of the wrapped observable.
|
static IObservableList |
staticObservableList(List list)
Returns an observable list backed by the given list.
|
static IObservableList |
staticObservableList(List list,
Object elementType)
Returns an observable list of the given element type, backed by the given
list.
|
static IObservableList |
staticObservableList(Realm realm,
List list)
Returns an observable list belonging to the given realm, backed by the
given list.
|
static IObservableList |
staticObservableList(Realm realm,
List list,
Object elementType)
Returns an observable list of the given element type and belonging to the
given realm, backed by the given list.
|
static IObservableSet |
staticObservableSet(Realm realm,
Set set)
Returns an observable set belonging to the given realm, backed by the
given set.
|
static IObservableSet |
staticObservableSet(Realm realm,
Set set,
Object elementType)
Returns an observable set of the given element type and belonging to the
given realm, backed by the given set.
|
static IObservableSet |
staticObservableSet(Set set)
Returns an observable set backed by the given set.
|
static IObservableSet |
staticObservableSet(Set set,
Object elementType)
Returns an observable set of the given element type, backed by the given
set.
|
static IObservableList |
unmodifiableObservableList(IObservableList list)
Returns an unmodifiable observable list backed by the given observable
list.
|
static IObservableMap |
unmodifiableObservableMap(IObservableMap map)
Returns an unmodifiable observable map backed by the given observable
map.
|
static IObservableSet |
unmodifiableObservableSet(IObservableSet set)
Returns an unmodifiable observable set backed by the given observable
set.
|
static IObservableValue |
unmodifiableObservableValue(IObservableValue value)
Returns an unmodifiable observable value backed by the given observable
value.
|
public static IObservableValue observeDelayedValue(int delay, IObservableValue observable)
observable
until delay
milliseconds have
elapsed since the last change event. This observable helps to boost
performance in situations where an observable has computationally
expensive listeners or many dependencies. 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:
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 IObservableValue unmodifiableObservableValue(IObservableValue value)
value
- the value to wrap in an unmodifiable valuepublic static IObservableValue constantObservableValue(Realm realm, Object value, Object valueType)
realm
- the observable's realmvalue
- the observable's constant valuevalueType
- the observable's value typepublic static IObservableValue constantObservableValue(Realm realm, Object value)
realm
- the observable's realmvalue
- the observable's constant valuepublic static IObservableValue constantObservableValue(Object value, Object valueType)
value
- the observable's constant valuevalueType
- the observable's value typepublic static IObservableValue constantObservableValue(Object value)
value
- the observable's constant valuepublic static IObservableList unmodifiableObservableList(IObservableList list)
list
- the list to wrap in an unmodifiable listpublic static IObservableSet unmodifiableObservableSet(IObservableSet set)
set
- the set to wrap in an unmodifiable setpublic static IObservableMap unmodifiableObservableMap(IObservableMap map)
map
- the map to wrap in an unmodifiable mappublic static IObservableList emptyObservableList()
public static IObservableList emptyObservableList(Object elementType)
elementType
- the element type of the returned listpublic static IObservableList emptyObservableList(Realm realm)
realm
- the realm of the returned listpublic static IObservableList emptyObservableList(Realm realm, Object elementType)
realm
- the realm of the returned listelementType
- the element type of the returned listpublic static IObservableSet emptyObservableSet()
public static IObservableSet emptyObservableSet(Object elementType)
elementType
- the element type of the returned setpublic static IObservableSet emptyObservableSet(Realm realm)
realm
- the realm of the returned setpublic static IObservableSet emptyObservableSet(Realm realm, Object elementType)
realm
- the realm of the returned setelementType
- the element type of the returned setpublic static IObservableSet staticObservableSet(Set set)
set
- the set to wrap in an IObservableSetpublic static IObservableSet staticObservableSet(Set set, Object elementType)
set
- the set to wrap in an IObservableSetelementType
- the element type of the returned setpublic static IObservableSet staticObservableSet(Realm realm, Set set)
realm
- the realm of the returned setset
- the set to wrap in an IObservableSetpublic static IObservableSet staticObservableSet(Realm realm, Set set, Object elementType)
realm
- the realm of the returned setset
- the set to wrap in an IObservableSetelementType
- the element type of the returned setpublic static IObservableValue proxyObservableValue(IObservableValue target)
target
- the observable value to wrappublic static IObservableSet proxyObservableSet(IObservableSet target)
target
- the set to wrappublic static IObservableList proxyObservableList(IObservableList target)
target
- the list to wrappublic static IObservableMap proxyObservableMap(IObservableMap target)
target
- the map to wrappublic static IObservableList staticObservableList(List list)
list
- the list to wrap in an IObservableListpublic static IObservableList staticObservableList(List list, Object elementType)
list
- the list to wrap in an IObservableListelementType
- the element type of the returned listpublic static IObservableList staticObservableList(Realm realm, List list)
realm
- the realm of the returned listlist
- the list to wrap in an IObservableListpublic static IObservableList staticObservableList(Realm realm, List list, Object elementType)
realm
- the realm of the returned listlist
- the list to wrap in an IObservableListelementType
- the element type of the returned listpublic static IObservableValue observeStale(IObservable observable)
Boolean.TYPE
which
tracks whether the given observable is stale.observable
- the observable to trackpublic static IObservableValue observeMapEntry(IObservableMap map, Object key)
The state where the key does not exist in the map is equivalent to the
state where the key exists and its value is null
. The
transition between these two states is not considered a value change and
no event is fired.
map
- the observable map whose entry will be tracked.key
- the key identifying the map entry to track.public static IObservableValue observeMapEntry(IObservableMap map, Object key, Object valueType)
The state where the key does not exist in the map is equivalent to the
state where the key exists and its value is null
. The
transition between these two states is not considered a value change and
no event is fired.
map
- the observable map whose entry will be tracked.key
- the key identifying the map entry to track.valueType
- the type of the value. May be null
, meaning the
value is untyped.public static IObservableFactory mapEntryValueFactory(IObservableMap map, Object valueType)
observable map
entry identified by a particular
key.map
- the observable map whose entry will be tracked.valueType
- the type of the value. May be null
, meaning the
value is untyped.public static IObservableValue observeDetailMapEntry(IObservableMap map, IObservableValue master, Object valueType)
MasterDetailObservables.detailValue(master,
mapEntryValueFactory(map, valueType), valueType)
.map
- the observable map whose entry will be tracked.master
- the observable value that identifies which map entry to track.valueType
- the type of the value. May be null
, meaning the
value is untyped.public static void pipe(IObservableValue source, IObservableValue destination)
source
- the source observabledestination
- the destination observable
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.