SortedList should provide a way to map source index to view index

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 8u60
    • Component/s: javafx
    • x86
    • windows_8

      A DESCRIPTION OF THE REQUEST :
      SortedList.getSourceIndex(int) allows translation from view index to source index. However, there is no way to determine view index from source. "sourceList.indexOf(sortedList.get(viewIdx))" (a) is inefficient and (b) won't work for lists with duplicate items.

      JUSTIFICATION :
      SortedList is a general purpose class. Mapping between model and view indices is its primary purpose so this functionality should be exposed. At present, relevant code is private (thus inaccessible to even subclasses).

      Sample use-case: controls may be backed by SortedList populated with immutable items. In this case, user updates trigger list element replacements rather than in-place modifications. Developer must be able to identify index within source list.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Add "public int getViewIndex(int index)" to SortedList. Possibly add corresponding abstract method to TransformationList as well.
      ACTUAL -
      No such method.

            Assignee:
            Vadim Pakhnushev
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: