Class ReadOnlyMapWrapperEx<K,V>
java.lang.Object
javafx.beans.binding.MapExpression<K,V>
javafx.beans.property.ReadOnlyMapProperty<K,V>
javafx.beans.property.MapProperty<K,V>
javafx.beans.property.MapPropertyBase<K,V>
javafx.beans.property.SimpleMapProperty<K,V>
javafx.beans.property.ReadOnlyMapWrapper<K,V>
org.eclipse.gef.common.beans.property.ReadOnlyMapWrapperEx<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,Property<ObservableMap<K,,V>> ReadOnlyProperty<ObservableMap<K,,V>> ObservableMapValue<K,,V> ObservableObjectValue<ObservableMap<K,,V>> ObservableValue<ObservableMap<K,,V>> WritableMapValue<K,,V> WritableObjectValue<ObservableMap<K,,V>> WritableValue<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)
- Bidirectional binding not working (https://bugs.openjdk.java.net/browse/JDK-8089557): fixed by not forwarding listeners to the nested read-only property but rather keeping the lists of listeners distinct.
-
Property Summary
Properties inherited from class javafx.beans.property.MapPropertyBase
empty, size -
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionThe constructor ofReadOnlyMapWrapperExReadOnlyMapWrapperEx(Object bean, String name) The constructor ofReadOnlyMapWrapperExReadOnlyMapWrapperEx(Object bean, String name, ObservableMap<K, V> initialValue) The constructor ofReadOnlyMapWrapperExReadOnlyMapWrapperEx(ObservableMap<K, V> initialValue) The constructor ofReadOnlyMapWrapperEx -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(InvalidationListener listener) voidaddListener(ChangeListener<? super ObservableMap<K, V>> listener) voidaddListener(MapChangeListener<? super K, ? super V> listener) protected voidprotected voidfireValueChangedEvent(MapChangeListener.Change<? extends K, ? extends V> change) Returns the readonly property, that is synchronized with thisReadOnlyMapWrapper.inthashCode()voidremoveListener(InvalidationListener listener) voidremoveListener(ChangeListener<? super ObservableMap<K, V>> listener) voidremoveListener(MapChangeListener<? super K, ? super V> listener) Methods inherited from class javafx.beans.property.SimpleMapProperty
getBean, getNameMethods inherited from class javafx.beans.property.MapPropertyBase
bind, emptyProperty, get, invalidated, isBound, set, sizeProperty, toString, unbindMethods inherited from class javafx.beans.property.MapProperty
bindBidirectional, setValue, unbindBidirectionalMethods inherited from class javafx.beans.property.ReadOnlyMapProperty
bindContent, bindContentBidirectional, equals, unbindContent, unbindContentBidirectionalMethods inherited from class javafx.beans.binding.MapExpression
asString, clear, containsKey, containsValue, entrySet, get, getSize, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, keySet, mapExpression, put, putAll, remove, size, valueAt, valueAt, valuesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from interface javafx.beans.value.ObservableValue
getValueMethods inherited from interface javafx.beans.value.WritableValue
getValue
-
Constructor Details
-
ReadOnlyMapWrapperEx
public ReadOnlyMapWrapperEx()The constructor ofReadOnlyMapWrapperEx -
ReadOnlyMapWrapperEx
The constructor ofReadOnlyMapWrapperEx- Parameters:
bean- the bean of thisReadOnlyMapWrapperExname- the name of thisReadOnlyMapWrapperEx
-
ReadOnlyMapWrapperEx
The constructor ofReadOnlyMapWrapperEx- Parameters:
bean- the bean of thisReadOnlyMapWrapperExname- the name of thisReadOnlyMapWrapperExinitialValue- the initial value of the wrapped value
-
ReadOnlyMapWrapperEx
The constructor ofReadOnlyMapWrapperEx- Parameters:
initialValue- the initial value of the wrapped value
-
-
Method Details
-
addListener
- Specified by:
addListenerin interfaceObservableValue<K>- Overrides:
addListenerin classMapPropertyBase<K,V>
-
addListener
- Specified by:
addListenerin interfaceObservable- Overrides:
addListenerin classMapPropertyBase<K,V>
-
addListener
- Specified by:
addListenerin interfaceObservableMap<K,V> - Overrides:
addListenerin classMapPropertyBase<K,V>
-
fireValueChangedEvent
protected void fireValueChangedEvent()- Overrides:
fireValueChangedEventin classReadOnlyMapWrapper<K,V>
-
fireValueChangedEvent
- Overrides:
fireValueChangedEventin classReadOnlyMapWrapper<K,V>
-
getReadOnlyProperty
Returns the readonly property, that is synchronized with thisReadOnlyMapWrapper.- Overrides:
getReadOnlyPropertyin classReadOnlyMapWrapper<K,V> - Returns:
- the readonly property
-
hashCode
public int hashCode() -
removeListener
- Specified by:
removeListenerin interfaceObservableValue<K>- Overrides:
removeListenerin classMapPropertyBase<K,V>
-
removeListener
- Specified by:
removeListenerin interfaceObservable- Overrides:
removeListenerin classMapPropertyBase<K,V>
-
removeListener
- Specified by:
removeListenerin interfaceObservableMap<K,V> - Overrides:
removeListenerin classMapPropertyBase<K,V>
-