Class ReadOnlySetWrapperEx<E>

  • Type Parameters:
    E - The element type of the wrapped ObservableSet.
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>, javafx.beans.Observable, javafx.beans.property.Property<javafx.collections.ObservableSet<E>>, javafx.beans.property.ReadOnlyProperty<javafx.collections.ObservableSet<E>>, javafx.beans.value.ObservableObjectValue<javafx.collections.ObservableSet<E>>, javafx.beans.value.ObservableSetValue<E>, javafx.beans.value.ObservableValue<javafx.collections.ObservableSet<E>>, javafx.beans.value.WritableObjectValue<javafx.collections.ObservableSet<E>>, javafx.beans.value.WritableSetValue<E>, javafx.beans.value.WritableValue<javafx.collections.ObservableSet<E>>, javafx.collections.ObservableSet<E>

    public class ReadOnlySetWrapperEx<E>
    extends javafx.beans.property.ReadOnlySetWrapper<E>
    A replacement for ReadOnlySetWrapper to fix the following JavaFX issues:
    • 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(javafx.beans.InvalidationListener listener)  
      void addListener​(javafx.beans.value.ChangeListener<? super javafx.collections.ObservableSet<E>> listener)  
      void addListener​(javafx.collections.SetChangeListener<? super E> listener)  
      protected void fireValueChangedEvent()  
      protected void fireValueChangedEvent​(javafx.collections.SetChangeListener.Change<? extends E> change)  
      javafx.beans.property.ReadOnlySetProperty<E> getReadOnlyProperty()  
      int hashCode()  
      void removeListener​(javafx.beans.InvalidationListener listener)  
      void removeListener​(javafx.beans.value.ChangeListener<? super javafx.collections.ObservableSet<E>> listener)  
      void removeListener​(javafx.collections.SetChangeListener<? super E> listener)  
      • Methods inherited from class javafx.beans.property.SimpleSetProperty

        getBean, getName
      • Methods inherited from class javafx.beans.property.SetPropertyBase

        bind, emptyProperty, get, invalidated, isBound, set, sizeProperty, toString, unbind
      • Methods inherited from class javafx.beans.property.SetProperty

        bindBidirectional, setValue, unbindBidirectional
      • Methods inherited from class javafx.beans.property.ReadOnlySetProperty

        bindContent, bindContentBidirectional, equals, unbindContent, unbindContentBidirectional
      • Methods inherited from class javafx.beans.binding.SetExpression

        add, addAll, asString, clear, contains, containsAll, getSize, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, iterator, remove, removeAll, retainAll, setExpression, size, toArray, toArray
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface javafx.beans.value.ObservableValue

        getValue
      • Methods inherited from interface java.util.Set

        add, addAll, clear, contains, containsAll, equals, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
      • Methods inherited from interface javafx.beans.value.WritableValue

        getValue
    • Constructor Detail

      • ReadOnlySetWrapperEx

        public ReadOnlySetWrapperEx​(java.lang.Object bean,
                                    java.lang.String name)
        Creates a new named ReadOnlySetWrapperEx related to the given bean.
        Parameters:
        bean - The bean to relate the to be created ReadOnlySetWrapperEx to.
        name - The name for the to be created ReadOnlySetWrapperEx.
      • ReadOnlySetWrapperEx

        public ReadOnlySetWrapperEx​(java.lang.Object bean,
                                    java.lang.String name,
                                    javafx.collections.ObservableSet<E> initialValue)
        Creates a new named ReadOnlySetWrapperEx, related to the given bean and provided with the initial value.
        Parameters:
        bean - The bean to relate the to be created ReadOnlySetWrapperEx to.
        name - The name for the to be created ReadOnlySetWrapperEx.
        initialValue - The initial value of the to be created ReadOnlySetWrapperEx.
      • ReadOnlySetWrapperEx

        public ReadOnlySetWrapperEx​(javafx.collections.ObservableSet<E> initialValue)
        Creates a new unnamed ReadOnlySetWrapperEx with the given initial value.
        Parameters:
        initialValue - The initial value of the to be created ReadOnlySetWrapperEx.
    • Method Detail

      • addListener

        public void addListener​(javafx.beans.value.ChangeListener<? super javafx.collections.ObservableSet<E>> listener)
        Specified by:
        addListener in interface javafx.beans.value.ObservableValue<E>
        Overrides:
        addListener in class javafx.beans.property.SetPropertyBase<E>
      • addListener

        public void addListener​(javafx.beans.InvalidationListener listener)
        Specified by:
        addListener in interface javafx.beans.Observable
        Overrides:
        addListener in class javafx.beans.property.SetPropertyBase<E>
      • addListener

        public void addListener​(javafx.collections.SetChangeListener<? super E> listener)
        Specified by:
        addListener in interface javafx.collections.ObservableSet<E>
        Overrides:
        addListener in class javafx.beans.property.SetPropertyBase<E>
      • fireValueChangedEvent

        protected void fireValueChangedEvent()
        Overrides:
        fireValueChangedEvent in class javafx.beans.property.ReadOnlySetWrapper<E>
      • fireValueChangedEvent

        protected void fireValueChangedEvent​(javafx.collections.SetChangeListener.Change<? extends E> change)
        Overrides:
        fireValueChangedEvent in class javafx.beans.property.ReadOnlySetWrapper<E>
      • getReadOnlyProperty

        public javafx.beans.property.ReadOnlySetProperty<E> getReadOnlyProperty()
        Overrides:
        getReadOnlyProperty in class javafx.beans.property.ReadOnlySetWrapper<E>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.Set<E>
        Overrides:
        hashCode in class javafx.beans.property.ReadOnlySetProperty<E>
      • removeListener

        public void removeListener​(javafx.beans.value.ChangeListener<? super javafx.collections.ObservableSet<E>> listener)
        Specified by:
        removeListener in interface javafx.beans.value.ObservableValue<E>
        Overrides:
        removeListener in class javafx.beans.property.SetPropertyBase<E>
      • removeListener

        public void removeListener​(javafx.beans.InvalidationListener listener)
        Specified by:
        removeListener in interface javafx.beans.Observable
        Overrides:
        removeListener in class javafx.beans.property.SetPropertyBase<E>
      • removeListener

        public void removeListener​(javafx.collections.SetChangeListener<? super E> listener)
        Specified by:
        removeListener in interface javafx.collections.ObservableSet<E>
        Overrides:
        removeListener in class javafx.beans.property.SetPropertyBase<E>