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
public class SetMultimapListenerHelper<K,V> extends java.lang.ObjectA utility class to support change notifications for anObservableSetMultimap.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSetMultimapListenerHelper.AtomicChange<K,V>A simple implementation of anSetMultimapChangeListener.Change.static classSetMultimapListenerHelper.ElementarySubChange<K,V>An elementary change related to a single key of aObservableSetMultimap. .
-
Constructor Summary
Constructors Constructor Description SetMultimapListenerHelper(ObservableSetMultimap<K,V> source)Constructs a newSetMultimapListenerHelperfor the given sourceObservableSetMultimap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(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>getSource()Returns the sourceObservableSetMultimapthisSetMultimapListenerHelperis bound to, which is used in change notifications.protected voidnotifyInvalidationListeners()Notifies 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 Detail
-
SetMultimapListenerHelper
public SetMultimapListenerHelper(ObservableSetMultimap<K,V> source)
Constructs a newSetMultimapListenerHelperfor the given sourceObservableSetMultimap.- Parameters:
source- TheObservableSetMultimapto use as source in change notifications.
-
-
Method Detail
-
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
public void addListener(SetMultimapChangeListener<? super K,? super V> listener)
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
public void fireValueChangedEvent(SetMultimapChangeListener.Change<? extends K,? extends V> change)
Notifies all attachedInvalidationListeners andSetMultimapChangeListeners about the change.- Parameters:
change- The change to notify listeners about.
-
getSource
protected ObservableSetMultimap<K,V> 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
public void removeListener(SetMultimapChangeListener<? super K,? super V> listener)
Removes the givenSetMultimapChangeListenerfrom thisSetMultimapListenerHelper. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-
-