Class MasterDetailObservables
- Since:
- 1.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <M,
E> IObservableList<E> detailList
(IObservableValue<M> master, IObservableFactory<? super M, IObservableList<E>> detailFactory, Object detailElementType) Creates a detail observable list from a master observable value and a factory.static <M,
K, V> IObservableMap<K, V> detailMap
(IObservableValue<M> master, IObservableFactory<? super M, IObservableMap<K, V>> detailFactory, Object detailKeyType, Object detailValueType) Creates a detail observable map from a master observable value and a factory.static <M,
K, V> IObservableMap<K, V> detailMap
(IObservableValue<M> master, IObservableFactory<M, IObservableMap<K, V>> detailFactory) Creates a detail observable map from a master observable value and a factory.static <M,
E> IObservableSet<E> detailSet
(IObservableValue<M> master, IObservableFactory<? super M, ? extends IObservableSet<E>> detailFactory, Object detailElementType) Creates a detail observable set from a master observable value and a factory.static <M,
T> IObservableValue<T> detailValue
(IObservableValue<M> master, IObservableFactory<? super M, IObservableValue<T>> detailFactory, Object detailType) Creates a detail observable value from a master observable value and a factory.static <M,
E> IObservableList<E> detailValues
(IObservableList<M> masterList, IObservableFactory<? super M, IObservableValue<E>> detailFactory, Object detailType) Returns a detail observable list where each element is the detail value of the element in the master observable list.static <K,
M, E> IObservableMap<K, E> detailValues
(IObservableMap<K, M> masterMap, IObservableFactory<? super M, IObservableValue<E>> detailFactory, Object detailType) Returns a detail observable map where the map's key set is the same as the one of the given master observable map, and where each value is the detail value of the corresponding value in the master observable map.static <M,
E> IObservableMap<M, E> detailValues
(IObservableSet<M> masterSet, IObservableFactory<? super M, IObservableValue<E>> detailFactory, Object detailType) Returns a detail observable map where the map's key set is the same as the given observable set, and where each value is the detail value of the element in the master observable set.
-
Constructor Details
-
MasterDetailObservables
public MasterDetailObservables()
-
-
Method Details
-
detailValue
public static <M,T> IObservableValue<T> detailValue(IObservableValue<M> master, IObservableFactory<? super M, IObservableValue<T>> detailFactory, Object detailType) Creates a detail observable value from a master observable value and a factory. This can be used to create observable values that represent a property of a selected object in a table.- Type Parameters:
M
- type of the master observableT
- type of the inner detail observable- Parameters:
master
- the observable value to trackdetailFactory
- a factory for creatingIObservableValue
instances given a current value of the masterdetailType
- the value type of the detail observable value, typically of type java.lang.Class and can benull
- Returns:
- an observable value of the given value type that, for any current value of the given master value, behaves like the observable value created by the factory for that current value.
-
detailList
public static <M,E> IObservableList<E> detailList(IObservableValue<M> master, IObservableFactory<? super M, IObservableList<E>> detailFactory, Object detailElementType) Creates a detail observable list from a master observable value and a factory. This can be used to create observable lists that represent a list property of a selected object in a table.- Type Parameters:
M
- type of the master observableE
- type of the elements in the inner observable set- Parameters:
master
- the observable value to trackdetailFactory
- a factory for creatingIObservableList
instances given a current value of the masterdetailElementType
- the element type of the detail observable list, typically of type java.lang.Class and can benull
- Returns:
- an observable list with the given element type that, for any current value of the given master value, behaves like the observable list created by the factory for that current value.
-
detailSet
public static <M,E> IObservableSet<E> detailSet(IObservableValue<M> master, IObservableFactory<? super M, ? extends IObservableSet<E>> detailFactory, Object detailElementType) Creates a detail observable set from a master observable value and a factory. This can be used to create observable sets that represent a set property of a selected object in a table.- Type Parameters:
M
- type of the master observableE
- type of the elements in the inner observable set- Parameters:
master
- the observable value to trackdetailFactory
- a factory for creatingIObservableSet
instances given a current value of the masterdetailElementType
- the element type of the detail observable set, typically of type java.lang.Class and can benull
- Returns:
- an observable set with the given element type that, for any current value of the given master value, behaves like the observable set created by the factory for that current value.
-
detailMap
public static <M,K, IObservableMap<K,V> V> detailMap(IObservableValue<M> master, IObservableFactory<M, IObservableMap<K, V>> detailFactory) Creates a detail observable map from a master observable value and a factory. This can be used to create observable maps that represent a map property of a selected object in a table.- Type Parameters:
M
- type of the master observableK
- type of the keys to the inner observable mapV
- type of the values in the inner observable map- Parameters:
master
- the observable value to trackdetailFactory
- a factory for creatingIObservableMap
instances given a current value of the master- Returns:
- an observable map that, for any current value of the given master value, behaves like the observable map created by the factory for that current value.
- Since:
- 1.1
-
detailMap
public static <M,K, IObservableMap<K,V> V> detailMap(IObservableValue<M> master, IObservableFactory<? super M, IObservableMap<K, V>> detailFactory, Object detailKeyType, Object detailValueType) Creates a detail observable map from a master observable value and a factory. This can be used to create observable maps that represent a map property of a selected object in a table.- Type Parameters:
M
- type of the master observableK
- type of the keys to the inner observable mapV
- type of the values in the inner observable map- Parameters:
master
- the observable value to trackdetailFactory
- a factory for creatingIObservableMap
instances given a current value of the masterdetailKeyType
- the element type of the detail observable map's key set, typically of type java.lang.Class and can benull
detailValueType
- the element type of the detail observable map's values collection, typically of type java.lang.Class and can benull
- Returns:
- an observable map that, for any current value of the given master value, behaves like the observable map created by the factory for that current value.
- Since:
- 1.2
-
detailValues
public static <M,E> IObservableList<E> detailValues(IObservableList<M> masterList, IObservableFactory<? super M, IObservableValue<E>> detailFactory, Object detailType) Returns a detail observable list where each element is the detail value of the element in the master observable list. The provided factory is used to create the detail observable values for every master element which then define the elements of the detail list. The detail list resides in the same realm as the given master list.Note that since the values of the returned list are detail values of the elements of the master list, the only modifications supported are through the
IObservableList.set(int, Object)
method. Modifications made through the returned list are made through the detail observables created by the specified observable factory.- Type Parameters:
M
- type of the master observables in the master listE
- type of the detail elements- Parameters:
masterList
- The master observable list.detailFactory
- The factory for creatingIObservableValue
instances for the elements of the master list which then define the elements of the new detail list.detailType
- The value type of the detail values, typically of typejava.lang.Class
. May benull
.- Returns:
- A detail observable list with elements which correspond to the detail values of the elements of the master list.
- Since:
- 1.4
-
detailValues
public static <M,E> IObservableMap<M,E> detailValues(IObservableSet<M> masterSet, IObservableFactory<? super M, IObservableValue<E>> detailFactory, Object detailType) Returns a detail observable map where the map's key set is the same as the given observable set, and where each value is the detail value of the element in the master observable set. The provided factory is used to create the detail observable values for every master key which then define the values of the detail map. The detail map resides in the same realm as the given master set.Note that since the values of the returned map are detail values of the elements of the master set, the only modifications supported are through the
IObservableMap.put(Object, Object)
andMap.putAll(java.util.Map)
methods. Therefore, the returned map does not add entries for elements not already contained in the master set. Modifications made through the returned detail map are made through the detail observables created by the specified observable factory.- Type Parameters:
M
- type of the master observables in the master setE
- type of the detail elements- Parameters:
masterSet
- The master observable set.detailFactory
- The factory for creatingIObservableValue
instances for the elements of the master set which then define the values of the new detail map.detailType
- The value type of the detail values, typically of typejava.lang.Class
. May benull
.- Returns:
- A detail observable map with the given master set as key set and with values which correspond to the detail values of the elements of the master set.
- Since:
- 1.4
-
detailValues
public static <K,M, IObservableMap<K,E> E> detailValues(IObservableMap<K, M> masterMap, IObservableFactory<? super M, IObservableValue<E>> detailFactory, Object detailType) Returns a detail observable map where the map's key set is the same as the one of the given master observable map, and where each value is the detail value of the corresponding value in the master observable map. The provided factory is used to create the detail observable values for every master value which then define the values of the detail map. The detail map resides in the same realm as the given master map.Note that since the values of the returned map are detail values of the values of the master map, the only modifications supported are through the
IObservableMap.put(Object, Object)
andMap.putAll(java.util.Map)
methods. Therefore, the returned map does not add entries for keys not already contained in the master map's key set. Modifications made through the returned detail map are made through the detail observables created by the specified observable factory.- Type Parameters:
K
- type of the keys (the keys to both the given master observable map and the keys to the returned detail map, both of which are the same set of keys)M
- type of the master observables in the master set, being the values of the given master observable mapE
- type of the detail elements, being the values of the returned detail map- Parameters:
masterMap
- The master observable map.detailFactory
- The factory for creatingIObservableValue
instances for the values of the master map which then define the values of the new detail map.detailType
- The value type of the detail values, typically of typejava.lang.Class
. May benull
.- Returns:
- A detail observable map with the same key set as the given master observable map and with values which correspond to the detail values of the values of the master map.
- Since:
- 1.4
-