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

Adding a TreeItem before the selected item does not correctly update the selection

    XMLWordPrintable

    Details

      Description

      Adding a TreeItem before the selected item does not correctly update the selection. Below is a test scenario added to TreeTableViewTest. For now It is ignored using this JBS issue.

      @Test public void testSelectionUpdatesCorrectlyAfterAddingAnItemBeforeSelectedItem() {
              setupForPermutationTest();
              TreeItem<String> parentOfSelectedTreeItem = ((TreeItem<String>)sm.getSelectedItem()).getParent();
              int indexOfSelectedItem = parentOfSelectedTreeItem.getChildren().indexOf(sm.getSelectedItem());
              if (indexOfSelectedItem > 0) {
                  indexOfSelectedItem--;
              }
              parentOfSelectedTreeItem.getChildren().add(indexOfSelectedItem, new TreeItem("AddingOne"));
              verifySelectionAfterPermutation();
          }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              arapte Ambarish Rapte
              Reporter:
              arapte Ambarish Rapte
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: