Class MapListenerHelperEx<K,V>
- java.lang.Object
-
- org.eclipse.gef.common.collections.MapListenerHelperEx<K,V>
-
- Type Parameters:
K- The key type of theObservableMap.V- The value type of theObservableMap.
- Direct Known Subclasses:
MapExpressionHelperEx
public class MapListenerHelperEx<K,V> extends java.lang.ObjectA utility class to support change notifications for anObservableMap, replacing the JavaFX-internalMapChangeListenerhelper class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapListenerHelperEx.AtomicChange<K,V>A simple implementation of anMapChangeListener.Change.
-
Constructor Summary
Constructors Constructor Description MapListenerHelperEx(javafx.collections.ObservableMap<K,V> source)Constructs a newMapListenerHelperExfor the given sourceObservableMap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(javafx.beans.InvalidationListener listener)Adds a newInvalidationListenerto thisMapListenerHelperEx.voidaddListener(javafx.collections.MapChangeListener<? super K,? super V> listener)Adds a newMapChangeListenerto thisMapListenerHelperEx.voidfireValueChangedEvent(javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)Notifies all attachedInvalidationListeners andMapChangeListeners about the change.protected javafx.collections.ObservableMap<K,V>getSource()Returns the sourceObservableMapthisMapListenerHelperExis bound to, which is used in change notifications.protected voidnotifyInvalidationListeners()Notifies all registeredInvalidationListeners.protected voidnotifyMapChangeListeners(javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)Notifies the attachedMapChangeListeners about the related change.voidremoveListener(javafx.beans.InvalidationListener listener)Removes the givenInvalidationListenerfrom thisMapListenerHelperEx.voidremoveListener(javafx.collections.MapChangeListener<? super K,? super V> listener)Removes the givenMapChangeListenerfrom thisMapListenerHelperEx.
-
-
-
Constructor Detail
-
MapListenerHelperEx
public MapListenerHelperEx(javafx.collections.ObservableMap<K,V> source)
Constructs a newMapListenerHelperExfor the given sourceObservableMap.- Parameters:
source- TheObservableMapto use as source in change notifications.
-
-
Method Detail
-
addListener
public void addListener(javafx.beans.InvalidationListener listener)
Adds a newInvalidationListenerto thisMapListenerHelperEx. 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.MapChangeListener<? super K,? super V> listener)
Adds a newMapChangeListenerto thisMapListenerHelperEx. 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.MapChangeListener.Change<? extends K,? extends V> change)
Notifies all attachedInvalidationListeners andMapChangeListeners about the change.- Parameters:
change- The change to notify listeners about.
-
getSource
protected javafx.collections.ObservableMap<K,V> getSource()
Returns the sourceObservableMapthisMapListenerHelperExis bound to, which is used in change notifications.- Returns:
- The source
ObservableMap.
-
notifyInvalidationListeners
protected void notifyInvalidationListeners()
Notifies all registeredInvalidationListeners.
-
notifyMapChangeListeners
protected void notifyMapChangeListeners(javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)
Notifies the attachedMapChangeListeners about the related change.- Parameters:
change- The applied change.
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener)
Removes the givenInvalidationListenerfrom thisMapListenerHelperEx. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-
removeListener
public void removeListener(javafx.collections.MapChangeListener<? super K,? super V> listener)
Removes the givenMapChangeListenerfrom thisMapListenerHelperEx. If its was registered more than once, removes one occurrence.- Parameters:
listener- The listener to remove.
-
-