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 class
A simple implementation of anSetChangeListener.Change
. -
Constructor Summary
ConstructorsConstructorDescriptionSetListenerHelperEx
(ObservableSet<E> source) Constructs a newSetListenerHelperEx
for the given sourceObservableSet
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(InvalidationListener listener) Adds a newInvalidationListener
to thisSetListenerHelperEx
.void
addListener
(SetChangeListener<? super E> listener) Adds a newSetChangeListener
to thisSetListenerHelperEx
.void
fireValueChangedEvent
(SetChangeListener.Change<? extends E> change) Notifies all attachedInvalidationListener
s andSetChangeListener
s about the change.protected ObservableSet<E>
Returns the sourceObservableSet
thisSetListenerHelperEx
is bound to, which is used in change notifications.protected void
Notifies all registeredInvalidationListener
s.protected void
notifySetChangeListeners
(SetChangeListener.Change<? extends E> change) Notifies the attachedSetChangeListener
s about the related change.void
removeListener
(InvalidationListener listener) Removes the givenInvalidationListener
from thisSetListenerHelperEx
.void
removeListener
(SetChangeListener<? super E> listener) Removes the givenSetChangeListener
from thisSetListenerHelperEx
.
-
Constructor Details
-
SetListenerHelperEx
Constructs a newSetListenerHelperEx
for the given sourceObservableSet
.- Parameters:
source
- TheObservableSet
to use as source in change notifications.
-
-
Method Details
-
addListener
Adds a newInvalidationListener
to 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 newSetChangeListener
to 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 attachedInvalidationListener
s andSetChangeListener
s about the change.- Parameters:
change
- The change to notify listeners about.
-
getSource
Returns the sourceObservableSet
thisSetListenerHelperEx
is bound to, which is used in change notifications.- Returns:
- The source
ObservableSet
.
-
notifyInvalidationListeners
protected void notifyInvalidationListeners()Notifies all registeredInvalidationListener
s. -
notifySetChangeListeners
Notifies the attachedSetChangeListener
s about the related change.- Parameters:
change
- The applied change.
-
removeListener
Removes the givenInvalidationListener
from thisSetListenerHelperEx
. If its was registered more than once, removes one occurrence.- Parameters:
listener
- The listener to remove.
-
removeListener
Removes the givenSetChangeListener
from thisSetListenerHelperEx
. If its was registered more than once, removes one occurrence.- Parameters:
listener
- The listener to remove.
-