Class Properties
java.lang.Object
org.eclipse.core.databinding.property.Properties
Contains static methods to operate on or return IProperty objects.
- Since:
- 1.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <S,T> IValueProperty <S, T> convertedValue(Object valueType, Function<? super S, ? extends T> converter) Returns anIValuePropertywhose value results from applying the given conversion function on the source object of the value property.static <S,T> IValueProperty <S, T> convertedValue(Function<? super S, ? extends T> converter) Returns an untypedIValueProperty.static <T> IValueProperty<IObservableValue<T>, T> observableValue(Object valueType) Returns a value property which observes the value of anIObservableValue.static <K,V, P> IObservableMap<K, ? extends P>[] observeEach(IObservableMap<K, V> domainMap, IValueProperty<? super V, ? extends P>... properties) Returns an array of observable maps where each maps observes the corresponding value property on all elements in the given domain map'svaluescollection, for each property in the given array.static <E,P> IObservableMap<E, ? extends P>[] observeEach(IObservableSet<E> domainSet, IValueProperty<? super E, ? extends P>... properties) Returns an array of observable maps where each map observes the corresponding value property on all elements in the given domain set, for each property in the given array.static <E> IListProperty<List<E>, E> Returns a list property which takes the source object (aList) as the property list.static <K,V> IMapProperty <Map<K, V>, K, V> Returns a map property which takes the source object (aMap) as the property map.static <E> ISetProperty<Set<E>, E> Returns a set property which takes the source object (aSet) as the property set.static <T> IValueProperty<T, T> Returns a value property which takes the source object itself as the property value.
-
Constructor Details
-
Properties
public Properties()
-
-
Method Details
-
observeEach
@SafeVarargs public static <E,P> IObservableMap<E,? extends P>[] observeEach(IObservableSet<E> domainSet, IValueProperty<? super E, ? extends P>... properties) Returns an array of observable maps where each map observes the corresponding value property on all elements in the given domain set, for each property in the given array.- Parameters:
domainSet- the set of elements whose properties will be observedproperties- array of value properties to observe on each element in the domain map'svaluescollection- Returns:
- an array of observable maps where each map observes the corresponding value property of the given domain set
-
observeEach
@SafeVarargs public static <K,V, IObservableMap<K,P> ? extends P>[] observeEach(IObservableMap<K, V> domainMap, IValueProperty<? super V, ? extends P>... properties) Returns an array of observable maps where each maps observes the corresponding value property on all elements in the given domain map'svaluescollection, for each property in the given array.- Parameters:
domainMap- the map of elements whose properties will be observedproperties- array of value properties to observe on each element in the domain map'svaluescollection- Returns:
- a list of observable maps where each maps observes the
corresponding value property on all elements in the given domain
map's
valuescollection, for each property in the given array - Since:
- 1.6
-
selfValue
Returns a value property which takes the source object itself as the property value. This property may be used to wrap an object in an unmodifiableIObservableValue.- Parameters:
valueType- the value type of the property- Returns:
- a value property which takes the source object itself as the property value.
-
selfList
Returns a list property which takes the source object (aList) as the property list. This property may be used to wrap an arbitrary List instance in anIObservableList.- Parameters:
elementType- the element type of the property- Returns:
- a list property which takes the source object (a
List) as the property list.
-
selfSet
Returns a set property which takes the source object (aSet) as the property set. This property may be used to wrap an arbitrary Set instance in anIObservableSet.- Parameters:
elementType- the element type of the property- Returns:
- a set property which takes the source object (a
Set) as the property set.
-
selfMap
Returns a map property which takes the source object (aMap) as the property map. This property may be used to wrap an arbitrary Map instance in anIObservableMap.- Parameters:
keyType- the key type of the propertyvalueType- the value type of the property- Returns:
- a map property which takes the source object (a
Mapas the property map.
-
observableValue
Returns a value property which observes the value of anIObservableValue. This property may be used e.g. for observing the respective values of anIObservableList<IObservableValue>.Calls to
IValueProperty.observe(Object)orIValueProperty.observe(Realm, Object)just cast the argument toIObservableValueand return it (the realm argument is ignored).- Parameters:
valueType- the value type of the property- Returns:
- a value property which observes the value of an
IObservableValue.
-
convertedValue
public static <S,T> IValueProperty<S,T> convertedValue(Object valueType, Function<? super S, ? extends T> converter) Returns anIValuePropertywhose value results from applying the given conversion function on the source object of the value property. Setting a value on the property is not supported.- Parameters:
valueType- value type of the property (after conversion); null if untypedconverter- converter to apply to the source object of the value property; not null- Returns:
- new instance of a value property, whose value is the result of applying the given converter to the source object
- Since:
- 1.8
-
convertedValue
Returns an untypedIValueProperty. Equivalent toconvertedValue(null, converter).- Parameters:
converter- seeconvertedValue(Object, Function)- Returns:
- see
convertedValue(Object, Function) - Since:
- 1.8
-