Class SetListenerHelperEx<E>
java.lang.Object
org.eclipse.gef.common.collections.SetListenerHelperEx<E>
- Type Parameters:
E- The element type of theObservableSet.
- Direct Known Subclasses:
SetExpressionHelperEx
A utility class to support change notifications for an
ObservableSet
, replacing the JavaFX-internal SetChangeListener helper class.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple implementation of anSetChangeListener.Change. -
Constructor Summary
ConstructorsConstructorDescriptionSetListenerHelperEx(javafx.collections.ObservableSet<E> source) Constructs a newSetListenerHelperExfor the given sourceObservableSet. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(javafx.beans.InvalidationListener listener) Adds a newInvalidationListenerto thisSetListenerHelperEx.voidaddListener(javafx.collections.SetChangeListener<? super E> listener) Adds a newSetChangeListenerto thisSetListenerHelperEx.voidfireValueChangedEvent(javafx.collections.SetChangeListener.Change<? extends E> change) Notifies all attachedInvalidationListeners andSetChangeListeners about the change.protected javafx.collections.ObservableSet<E>Returns the sourceObservableSetthisSetListenerHelperExis bound to, which is used in change notifications.protected voidNotifies all registeredInvalidationListeners.protected voidnotifySetChangeListeners(javafx.collections.SetChangeListener.Change<? extends E> change) Notifies the attachedSetChangeListeners about the related change.voidremoveListener(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListenerfrom thisSetListenerHelperEx.voidremoveListener(javafx.collections.SetChangeListener<? super E> listener) Removes the givenSetChangeListenerfrom thisSetListenerHelperEx.
-
Constructor Details
-
SetListenerHelperEx
Constructs a newSetListenerHelperExfor the given sourceObservableSet.- Parameters:
source- TheObservableSetto use as source in change notifications.
-
-
Method Details
-
addListener
public void addListener(javafx.beans.InvalidationListener listener) Adds a newInvalidationListenerto thisSetListenerHelperEx. 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 newSetChangeListenerto thisSetListenerHelperEx. 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 andSetChangeListeners about the change.- Parameters:
change- The change to notify listeners about.
-
getSource
Returns the sourceObservableSetthisSetListenerHelperExis bound to, which is used in change notifications.- Returns:
- The source
ObservableSet.
-
notifyInvalidationListeners
protected void notifyInvalidationListeners()Notifies all registeredInvalidationListeners. -
notifySetChangeListeners
protected void notifySetChangeListeners(javafx.collections.SetChangeListener.Change<? extends E> change) Notifies the attachedSetChangeListeners about the related change.- Parameters:
change- The applied change.
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener) Removes the givenInvalidationListenerfrom thisSetListenerHelperEx. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-
removeListener
Removes the givenSetChangeListenerfrom thisSetListenerHelperEx. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-