K
- The key type of the ObservableMap
.V
- The value type of the ObservableMap
.public class MapListenerHelperEx<K,V>
extends java.lang.Object
ObservableMap
, replacing the JavaFX-internal MapChangeListener
helper class.Modifier and Type | Class and Description |
---|---|
static class |
MapListenerHelperEx.AtomicChange<K,V>
A simple implementation of an
MapChangeListener.Change . |
Constructor and Description |
---|
MapListenerHelperEx(javafx.collections.ObservableMap<K,V> source)
Constructs a new
MapListenerHelperEx for the given source
ObservableMap . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(javafx.beans.InvalidationListener listener)
Adds a new
InvalidationListener to this
MapListenerHelperEx . |
void |
addListener(javafx.collections.MapChangeListener<? super K,? super V> listener)
Adds a new
MapChangeListener to this MapListenerHelperEx . |
void |
fireValueChangedEvent(javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)
Notifies all attached
InvalidationListener s and
MapChangeListener s about the change. |
protected javafx.collections.ObservableMap<K,V> |
getSource()
Returns the source
ObservableMap this MapListenerHelperEx
is bound to, which is used in change notifications. |
protected void |
notifyInvalidationListeners()
Notifies all registered
InvalidationListener s. |
protected void |
notifyMapChangeListeners(javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)
Notifies the attached
MapChangeListener s about the related
change. |
void |
removeListener(javafx.beans.InvalidationListener listener)
Removes the given
InvalidationListener from this
MapListenerHelperEx . |
void |
removeListener(javafx.collections.MapChangeListener<? super K,? super V> listener)
Removes the given
MapChangeListener from this
MapListenerHelperEx . |
public MapListenerHelperEx(javafx.collections.ObservableMap<K,V> source)
MapListenerHelperEx
for the given source
ObservableMap
.source
- The ObservableMap
to use as source in change
notifications.public void addListener(javafx.beans.InvalidationListener listener)
InvalidationListener
to this
MapListenerHelperEx
. If the same listener is added more than
once, it will be registered more than once and will receive multiple
change events.listener
- The listener to add.public void addListener(javafx.collections.MapChangeListener<? super K,? super V> listener)
MapChangeListener
to this MapListenerHelperEx
.
If the same listener is added more than once, it will be registered more
than once and will receive multiple change events.listener
- The listener to add.public void fireValueChangedEvent(javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)
InvalidationListener
s and
MapChangeListener
s about the change.change
- The change to notify listeners about.protected javafx.collections.ObservableMap<K,V> getSource()
ObservableMap
this MapListenerHelperEx
is bound to, which is used in change notifications.ObservableMap
.protected void notifyInvalidationListeners()
InvalidationListener
s.protected void notifyMapChangeListeners(javafx.collections.MapChangeListener.Change<? extends K,? extends V> change)
MapChangeListener
s about the related
change.change
- The applied change.public void removeListener(javafx.beans.InvalidationListener listener)
InvalidationListener
from this
MapListenerHelperEx
. If its was registered more than once,
removes one occurrence.listener
- The listener to remove.public void removeListener(javafx.collections.MapChangeListener<? super K,? super V> listener)
MapChangeListener
from this
MapListenerHelperEx
. If its was registered more than once,
removes one occurrence.listener
- The listener to remove.Copyright (c) 2014 itemis AG and others. All rights reserved.