Class SetMultimapListenerHelper<K,V>
java.lang.Object
org.eclipse.gef.common.collections.SetMultimapListenerHelper<K,V>
- Type Parameters:
K- The key type of theObservableSetMultimap.V- The value type of theObservableSetMultimap.
- Direct Known Subclasses:
SetMultimapExpressionHelper
A utility class to support change notifications for an
ObservableSetMultimap.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple implementation of anSetMultimapChangeListener.Change.static classAn elementary change related to a single key of aObservableSetMultimap. . -
Constructor Summary
ConstructorsConstructorDescriptionSetMultimapListenerHelper(ObservableSetMultimap<K, V> source) Constructs a newSetMultimapListenerHelperfor the given sourceObservableSetMultimap. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(javafx.beans.InvalidationListener listener) Adds a newInvalidationListenerto thisSetMultimapListenerHelper.voidaddListener(SetMultimapChangeListener<? super K, ? super V> listener) Adds a newSetMultimapChangeListenerto thisSetMultimapListenerHelper.voidfireValueChangedEvent(SetMultimapChangeListener.Change<? extends K, ? extends V> change) Notifies all attachedInvalidationListeners andSetMultimapChangeListeners about the change.protected ObservableSetMultimap<K,V> Returns the sourceObservableSetMultimapthisSetMultimapListenerHelperis bound to, which is used in change notifications.protected voidNotifies all registeredInvalidationListeners.protected voidnotifySetMultimapChangeListeners(SetMultimapChangeListener.Change<? extends K, ? extends V> change) Notifies the attachedSetMultimapChangeListeners about the related change.voidremoveListener(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListenerfrom thisSetMultimapListenerHelper.voidremoveListener(SetMultimapChangeListener<? super K, ? super V> listener) Removes the givenSetMultimapChangeListenerfrom thisSetMultimapListenerHelper.
-
Constructor Details
-
SetMultimapListenerHelper
Constructs a newSetMultimapListenerHelperfor the given sourceObservableSetMultimap.- Parameters:
source- TheObservableSetMultimapto use as source in change notifications.
-
-
Method Details
-
addListener
public void addListener(javafx.beans.InvalidationListener listener) Adds a newInvalidationListenerto thisSetMultimapListenerHelper. If the same listener is added more than once, it will be registered more than once and will receive multiple change events.- Parameters:
listener- The listener to add.
-
addListener
Adds a newSetMultimapChangeListenerto thisSetMultimapListenerHelper. If the same listener is added more than once, it will be registered more than once and will receive multiple change events.- Parameters:
listener- The listener to add.
-
fireValueChangedEvent
Notifies all attachedInvalidationListeners andSetMultimapChangeListeners about the change.- Parameters:
change- The change to notify listeners about.
-
getSource
Returns the sourceObservableSetMultimapthisSetMultimapListenerHelperis bound to, which is used in change notifications.- Returns:
- The source
ObservableSetMultimap.
-
notifyInvalidationListeners
protected void notifyInvalidationListeners()Notifies all registeredInvalidationListeners. -
notifySetMultimapChangeListeners
protected void notifySetMultimapChangeListeners(SetMultimapChangeListener.Change<? extends K, ? extends V> change) Notifies the attachedSetMultimapChangeListeners about the related change.- Parameters:
change- The applied change.
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListenerfrom thisSetMultimapListenerHelper. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-
removeListener
Removes the givenSetMultimapChangeListenerfrom thisSetMultimapListenerHelper. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-