Class MultisetListenerHelper<E>
java.lang.Object
org.eclipse.gef.common.collections.MultisetListenerHelper<E>
- Type Parameters:
E- The element type of theObservableMultiset.
- Direct Known Subclasses:
MultisetExpressionHelper
A utility class to support change notifications for an
ObservableMultiset.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple implementation of anMultisetChangeListener.Change.static classAn elementary change related to a single element of aMultiset. -
Constructor Summary
ConstructorsConstructorDescriptionMultisetListenerHelper(ObservableMultiset<E> source) Constructs a newMultisetListenerHelperfor the given sourceObservableMultiset. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(javafx.beans.InvalidationListener listener) Adds a newInvalidationListenerto thisMultisetListenerHelper.voidaddListener(MultisetChangeListener<? super E> listener) Adds a newSetMultimapChangeListenerto thisMultisetListenerHelper.voidfireValueChangedEvent(MultisetChangeListener.Change<? extends E> change) Notifies all attachedInvalidationListeners andMultisetChangeListeners about the change.protected ObservableMultiset<E>Returns the sourceObservableMultisetthisMultisetListenerHelperis bound to, which is used in change notifications.protected voidNotifies all registeredInvalidationListeners.protected voidnotifyMultisetChangeListeners(MultisetChangeListener.Change<? extends E> change) Notifies the attachedMultisetChangeListeners about the related change.voidremoveListener(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListenerfrom thisMultisetListenerHelper.voidremoveListener(MultisetChangeListener<? super E> listener) Removes the givenMultisetChangeListenerfrom thisMultisetListenerHelper.
-
Constructor Details
-
MultisetListenerHelper
Constructs a newMultisetListenerHelperfor the given sourceObservableMultiset.- Parameters:
source- TheObservableMultisetto use as source in change notifications.
-
-
Method Details
-
addListener
public void addListener(javafx.beans.InvalidationListener listener) Adds a newInvalidationListenerto thisMultisetListenerHelper. 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 thisMultisetListenerHelper. 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 andMultisetChangeListeners about the change.- Parameters:
change- The change to notify listeners about.
-
getSource
Returns the sourceObservableMultisetthisMultisetListenerHelperis bound to, which is used in change notifications.- Returns:
- The source
ObservableMultiset.
-
notifyInvalidationListeners
protected void notifyInvalidationListeners()Notifies all registeredInvalidationListeners. -
notifyMultisetChangeListeners
Notifies the attachedMultisetChangeListeners about the related change.- Parameters:
change- The applied change.
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListenerfrom thisMultisetListenerHelper. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-
removeListener
Removes the givenMultisetChangeListenerfrom thisMultisetListenerHelper. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-