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
public class SetListenerHelperEx<E> extends java.lang.Object
A utility class to support change notifications for anObservableSet
, replacing the JavaFX-internalSetChangeListener
helper class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SetListenerHelperEx.AtomicChange<E>
A simple implementation of anSetChangeListener.Change
.
-
Constructor Summary
Constructors Constructor Description SetListenerHelperEx(javafx.collections.ObservableSet<E> source)
Constructs a newSetListenerHelperEx
for the given sourceObservableSet
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(javafx.beans.InvalidationListener listener)
Adds a newInvalidationListener
to thisSetListenerHelperEx
.void
addListener(javafx.collections.SetChangeListener<? super E> listener)
Adds a newSetChangeListener
to thisSetListenerHelperEx
.void
fireValueChangedEvent(javafx.collections.SetChangeListener.Change<? extends E> change)
Notifies all attachedInvalidationListener
s andSetChangeListener
s about the change.protected javafx.collections.ObservableSet<E>
getSource()
Returns the sourceObservableSet
thisSetListenerHelperEx
is bound to, which is used in change notifications.protected void
notifyInvalidationListeners()
Notifies all registeredInvalidationListener
s.protected void
notifySetChangeListeners(javafx.collections.SetChangeListener.Change<? extends E> change)
Notifies the attachedSetChangeListener
s about the related change.void
removeListener(javafx.beans.InvalidationListener listener)
Removes the givenInvalidationListener
from thisSetListenerHelperEx
.void
removeListener(javafx.collections.SetChangeListener<? super E> listener)
Removes the givenSetChangeListener
from thisSetListenerHelperEx
.
-
-
-
Constructor Detail
-
SetListenerHelperEx
public SetListenerHelperEx(javafx.collections.ObservableSet<E> source)
Constructs a newSetListenerHelperEx
for the given sourceObservableSet
.- Parameters:
source
- TheObservableSet
to use as source in change notifications.
-
-
Method Detail
-
addListener
public void addListener(javafx.beans.InvalidationListener listener)
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
public void addListener(javafx.collections.SetChangeListener<? super E> listener)
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
public void fireValueChangedEvent(javafx.collections.SetChangeListener.Change<? extends E> change)
Notifies all attachedInvalidationListener
s andSetChangeListener
s about the change.- Parameters:
change
- The change to notify listeners about.
-
getSource
protected javafx.collections.ObservableSet<E> 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
protected void notifySetChangeListeners(javafx.collections.SetChangeListener.Change<? extends E> change)
Notifies the attachedSetChangeListener
s about the related change.- Parameters:
change
- The applied change.
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener)
Removes the givenInvalidationListener
from thisSetListenerHelperEx
. If its was registered more than once, removes one occurrence.- Parameters:
listener
- The listener to remove.
-
removeListener
public void removeListener(javafx.collections.SetChangeListener<? super E> listener)
Removes the givenSetChangeListener
from thisSetListenerHelperEx
. If its was registered more than once, removes one occurrence.- Parameters:
listener
- The listener to remove.
-
-