Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-471

Make TableView.getSelectedRanges() iterable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.5
    • wtk

    Description

      Iterating over the results of TableView.getSelectedRanges() is cumbersome because it returns a Sequence<Span> which is not iterable using a for-each loop. Instead it should return a List<Span>, which is iterable. Javadoc should state that the returned List is immutable.

      Likewise for:

      • ListView.getSelectedRanges()
      • TreeView.getSelectedPaths()
      • FileBrowser.getSelectedFiles()
      • FileBrowserSheet.getSelectedFiles()

      JavaDoc of TableView.getSelectedRows() should clearly state that this is a convenience method only, and that it allocates a result array on each invocation. Likewise for ListView.getSelectedItems().

      See http://mail-archives.apache.org/mod_mbox/pivot-user/201004.mbox/%3c20100419141642.10608d0zs3wp5cx4@www.premium-webmail.de%3e for motivation of this issue.

      Attachments

        1. ListSelection_toString.patch.txt
          2 kB
          Gregory K. Brown

        Activity

          People

            Unassigned Unassigned
            dmoebius Dirk Moebius
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: