Class ReadOnlyMapPropertyBaseEx<K,V>
java.lang.Object
javafx.beans.binding.MapExpression<K,V>
javafx.beans.property.ReadOnlyMapProperty<K,V>
javafx.beans.property.ReadOnlyMapPropertyBase<K,V>
org.eclipse.gef.common.beans.property.ReadOnlyMapPropertyBaseEx<K,V>
- Type Parameters:
K
- The key type of the wrappedObservableMap
.V
- The value type of the wrappedObservableMap
.
- All Implemented Interfaces:
Map<K,
,V> Observable
,ReadOnlyProperty<ObservableMap<K,
,V>> ObservableMapValue<K,
,V> ObservableObjectValue<ObservableMap<K,
,V>> ObservableValue<ObservableMap<K,
,V>> ObservableMap<K,
V>
A replacement for
ReadOnlyMapWrapper
to fix the following JavaFX
issues:
- All listeners were removed when removing one (https://bugs.openjdk.java.net/browse/JDK-8136465): fixed by keeping track of all listeners and ensuring that remaining listeners are re-added when a listener is removed.
- Change notifications are fired even when the observed value did not change.(https://bugs.openjdk.java.net/browse/JDK-8089169)
-
Property Summary
Properties inherited from class javafx.beans.binding.MapExpression
empty, size
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(InvalidationListener listener) void
addListener
(ChangeListener<? super ObservableMap<K, V>> listener) void
addListener
(MapChangeListener<? super K, ? super V> listener) protected void
protected void
fireValueChangedEvent
(MapChangeListener.Change<? extends K, ? extends V> change) int
hashCode()
void
removeListener
(InvalidationListener listener) void
removeListener
(ChangeListener<? super ObservableMap<K, V>> listener) void
removeListener
(MapChangeListener<? super K, ? super V> listener) Methods inherited from class javafx.beans.property.ReadOnlyMapProperty
bindContent, bindContentBidirectional, equals, toString, unbindContent, unbindContentBidirectional
Methods inherited from class javafx.beans.binding.MapExpression
asString, clear, containsKey, containsValue, emptyProperty, entrySet, get, getSize, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, keySet, mapExpression, put, putAll, remove, size, sizeProperty, valueAt, valueAt, values
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
Methods inherited from interface javafx.beans.value.ObservableObjectValue
get
Methods inherited from interface javafx.beans.value.ObservableValue
getValue
Methods inherited from interface javafx.beans.property.ReadOnlyProperty
getBean, getName
-
Constructor Details
-
ReadOnlyMapPropertyBaseEx
public ReadOnlyMapPropertyBaseEx()
-
-
Method Details
-
addListener
- Specified by:
addListener
in interfaceObservableValue<K>
- Overrides:
addListener
in classReadOnlyMapPropertyBase<K,
V>
-
addListener
- Specified by:
addListener
in interfaceObservable
- Overrides:
addListener
in classReadOnlyMapPropertyBase<K,
V>
-
addListener
- Specified by:
addListener
in interfaceObservableMap<K,
V> - Overrides:
addListener
in classReadOnlyMapPropertyBase<K,
V>
-
fireValueChangedEvent
protected void fireValueChangedEvent()- Overrides:
fireValueChangedEvent
in classReadOnlyMapPropertyBase<K,
V>
-
fireValueChangedEvent
- Overrides:
fireValueChangedEvent
in classReadOnlyMapPropertyBase<K,
V>
-
hashCode
public int hashCode() -
removeListener
- Specified by:
removeListener
in interfaceObservableValue<K>
- Overrides:
removeListener
in classReadOnlyMapPropertyBase<K,
V>
-
removeListener
- Specified by:
removeListener
in interfaceObservable
- Overrides:
removeListener
in classReadOnlyMapPropertyBase<K,
V>
-
removeListener
- Specified by:
removeListener
in interfaceObservableMap<K,
V> - Overrides:
removeListener
in classReadOnlyMapPropertyBase<K,
V>
-