Class BindingUtils
java.lang.Object
org.eclipse.gef.common.beans.binding.BindingUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> void
bindContent
(Multiset<E> source, ObservableMultiset<? extends E> target) Creates a unidirectional content binding from the given sourceMultiset
to the given targetObservableMultiset
.static <K,
V> void bindContent
(SetMultimap<K, V> source, ObservableSetMultimap<? extends K, ? extends V> target) Creates a unidirectional content binding from the given sourceSetMultimap
to the given targetObservableSetMultimap
.static <E> void
bindContentBidirectional
(ObservableMultiset<E> source, ObservableMultiset<E> target) Creates a bidirectional content binding between the givenObservableMultisets
.static <K,
V> void bindContentBidirectional
(ObservableSetMultimap<K, V> source, ObservableSetMultimap<K, V> target) Creates a unidirectional content binding between the givenObservableSetMultimaps
.static <E> void
unbindContent
(Multiset<E> source, ObservableMultiset<? extends E> target) Removes an existing content binding from the given sourceMultiset
to the given targetObservableMultiset
.static <K,
V> void unbindContent
(SetMultimap<K, V> source, ObservableSetMultimap<? extends K, ? extends V> target) Removes an existing unidirectional content binding from the given sourceSetMultimap
to the given targetObservableSetMultimap
.static <E> void
unbindContentBidirectional
(ObservableMultiset<E> multiset1, ObservableMultiset<E> multiset2) Removes a bidirectional content binding between the givenObservableMultisets
. .static <K,
V> void unbindContentBidirectional
(ObservableSetMultimap<K, V> source, ObservableSetMultimap<K, V> target) Removes a bidirectional content binding between the givenObservableSetMultimaps
.static <K,
V> SetBinding<V> valuesAt
(ObservableSetMultimap<K, V> setMultimap, ObservableValue<K> key) Creates a newObjectBinding
that contains the values mapped to the specified key.static <K,
V> SetBinding<V> valuesAt
(ObservableSetMultimap<K, V> setMultimap, K key) Creates a newObjectBinding
that contains the values mapped to the specified key.
-
Constructor Details
-
BindingUtils
public BindingUtils()
-
-
Method Details
-
bindContent
Creates a unidirectional content binding from the given sourceMultiset
to the given targetObservableMultiset
.- Type Parameters:
E
- The element type of the givenMultiset
andObservableMultiset
.- Parameters:
source
- TheMultiset
whose content to update when the givenObservableMultiset
changes.target
- TheObservableMultiset
whose content is to be observed.
-
bindContent
public static <K,V> void bindContent(SetMultimap<K, V> source, ObservableSetMultimap<? extends K, ? extends V> target) Creates a unidirectional content binding from the given sourceSetMultimap
to the given targetObservableSetMultimap
.- Type Parameters:
K
- The key type of the givenSetMultimap
andObservableSetMultimap
.V
- The value type of the givenSetMultimap
andObservableSetMultimap
.- Parameters:
source
- TheSetMultimap
whose content to update when the givenObservableSetMultimap
changes.target
- TheObservableSetMultimap
whose content is to be observed.
-
bindContentBidirectional
public static <E> void bindContentBidirectional(ObservableMultiset<E> source, ObservableMultiset<E> target) Creates a bidirectional content binding between the givenObservableMultisets
.- Type Parameters:
E
- The element type of the givenObservableMultisets
.- Parameters:
source
- The first participant of the bidirectional binding. Its contents will be initially replaced with that of the second participant before both are synchronized.target
- The second participant of the bidirectional binding. Its contents will be initially taken to update the contents of the first participant before both are synchronized.
-
bindContentBidirectional
public static <K,V> void bindContentBidirectional(ObservableSetMultimap<K, V> source, ObservableSetMultimap<K, V> target) Creates a unidirectional content binding between the givenObservableSetMultimaps
.- Type Parameters:
K
- The key type of the givenObservableSetMultimaps
.V
- The value type of the givenObservableSetMultimaps
.- Parameters:
source
- The first participant of the bidirectional binding. Its contents will be initially replaced with that of the second participant before both are synchronized.target
- The second participant of the bidirectional binding. Its contents will be initially taken to update the contents of the first participant before both are synchronized.
-
unbindContent
Removes an existing content binding from the given sourceMultiset
to the given targetObservableMultiset
.- Type Parameters:
E
- The element types of theMultiset
andObservableMultiset
.- Parameters:
source
- TheMultiset
whose content should no longer be updated when the givenObservableMultiset
changes.target
- TheObservableMultiset
whose content is no longer to be observed.
-
unbindContent
public static <K,V> void unbindContent(SetMultimap<K, V> source, ObservableSetMultimap<? extends K, ? extends V> target) Removes an existing unidirectional content binding from the given sourceSetMultimap
to the given targetObservableSetMultimap
.- Type Parameters:
K
- The key type of the givenSetMultimap
andObservableSetMultimap
.V
- The value type of the givenSetMultimap
andObservableSetMultimap
.- Parameters:
source
- TheSetMultimap
whose content is no longer to update when the givenObservableSetMultimap
changes.target
- TheObservableSetMultimap
whose content is no longer to be observed.
-
unbindContentBidirectional
public static <E> void unbindContentBidirectional(ObservableMultiset<E> multiset1, ObservableMultiset<E> multiset2) Removes a bidirectional content binding between the givenObservableMultisets
. .- Type Parameters:
E
- The element type of the givenObservableMultisets
.- Parameters:
multiset1
- The first participant of the bidirectional binding.multiset2
- The second participant of the bidirectional binding.
-
unbindContentBidirectional
public static <K,V> void unbindContentBidirectional(ObservableSetMultimap<K, V> source, ObservableSetMultimap<K, V> target) Removes a bidirectional content binding between the givenObservableSetMultimaps
.- Type Parameters:
K
- The key type of the givenObservableSetMultimaps
.V
- The value type of the givenObservableSetMultimaps
.- Parameters:
source
- The first participant of the bidirectional binding.target
- The second participant of the bidirectional binding.
-
valuesAt
Creates a newObjectBinding
that contains the values mapped to the specified key.- Type Parameters:
K
- The key type of theObservableSetMultimap
.V
- The value type of theObservableSetMultimap
.- Parameters:
setMultimap
- TheObservableSetMultimap
from which the values are to be retrieved.key
- the key of the mapping- Returns:
- A new
ObjectBinding
.
-
valuesAt
public static <K,V> SetBinding<V> valuesAt(ObservableSetMultimap<K, V> setMultimap, ObservableValue<K> key) Creates a newObjectBinding
that contains the values mapped to the specified key.- Type Parameters:
K
- The key type of theObservableSetMultimap
.V
- The value type of theObservableSetMultimap
.- Parameters:
setMultimap
- TheObservableSetMultimap
from which the values are to be retrieved.key
- the key of the mapping- Returns:
- A new
ObjectBinding
.
-