Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8305172

ObservableLists would benefit from an `onChanging` method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • javafx
    • None

      Currently, there is a `TrackableObservableList` which is just a regular observable list with a listener attached to it which then calls an `onChanged` method. The users of this list then override this `onChanged` method to keep track of changes (this is more efficient than using a listener, but only IF you avoid creating the listener in the first place, like how its implemented for `ObjectBinding#onInvalidating`). In this case however, the listener is still created.

      There are many such lists in use, multiple in each `Node` and many per stylesheet. All of these register a listener, which in turn creates an `ExpressionHelper` -- two instances that can be avoided.

      The proposal is to remove `TrackableObservableList` and provide this functionality in `ObservableListBase` or one of its subclasses.

            jhendrikx John Hendrikx
            jhendrikx John Hendrikx
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: