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

TableView multiple selection with keyboard actions results in duplicates

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u10
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Environment:

      OS 10.8

      Description

      Environment:

      OS X 10.8.2

      java version "1.7.0_10-ea"
      Java(TM) SE Runtime Environment (build 1.7.0_10-ea-b08)
      Java HotSpot(TM) 64-Bit Server VM (build 23.6-b03, mixed mode)

      javafx.runtime.version: 2.2.4-ea-b08

      ----

      Steps.

      1. In your favorite IDE with the output console open, run the TableSample app attached to this issue.

      2. With the down arrow key gesture, select the first row. Output as expected for a single row selected:

      Selected: 1 item(s) [0]: Jacob

      3. Then select the second row by arrow-down gesture. Output as expected for a single row selected:

      Selected: 1 item(s) [1]: Isabella

      4. Move the selection back up to the first row using the arrow-up gesture. Output as expected:

      Selected: 1 item(s) [0]: Jacob

      5. Perform a single Shift-(down-arrow) gesture to extend the selection by one row. Output shows:

      Selected: 3 item(s) [0, 0, 1]: Jacob Jacob Isabella

      6. Continue Shift-down-arrow multi-selection gesture to include all rows: Output shows duplicate rows in the selection collections (indices and items):

      Selected: 7 item(s) [0, 0, 1, 0, 2, 0, 3]: Jacob Jacob Isabella Jacob Ethan Jacob Emma
      Selected: 7 item(s) [0, 0, 1, 0, 2, 0, 3]: Jacob Jacob Isabella Jacob Ethan Jacob Emma

      7. Now play with all kinds of multiple selection keyboard initiated gestures, moving up and down with the current selection and take note of the duplications, which I will not show here.

      Record your actions and make sure you write unit tests which cover those ... and more.

      ...

      Now for something very strange, meaning "for gestures which work as expected".

      1. Clear the selection and use the down-arrow gesture to go to the last row.

      2. Shift-up-arrow select up gesture to the first row. Progressively, the output contains no duplicate indices or items, as expected.

      Selected: 1 item(s) [4]: Michael
      Selected: 2 item(s) [4, 3]: Michael Emma
      Selected: 3 item(s) [3, 4, 2]: Emma Michael Ethan
      Selected: 4 item(s) [3, 2, 4, 1]: Emma Ethan Michael Isabella
      Selected: 5 item(s) [3, 2, 1, 4, 0]: Emma Ethan Isabella Michael Jacob

      3. Work your way down and then up with the Shift-key-pressed gesture and you will see the expected results. For down-arrowing progressively from the previous step:

      Selected: 4 item(s) [3, 2, 1, 4]: Emma Ethan Isabella Michael
      Selected: 3 item(s) [3, 2, 4]: Emma Ethan Michael
      Selected: 2 item(s) [3, 4]: Emma Michael
      Selected: 1 item(s) [4]: Michael

      Just as expected.


      So, some gestures work, namely, those which start/originate in the upward direction.

      ---

      Note that the attachment contains an Eclipse project with the source code. Sorry, no NetBeans project included.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jgiles Jonathan Giles
              Reporter:
              pfurbachejfx Paul Furbacher (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: