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

TreeCell: cancelEvent must return correct editing location

    XMLWordPrintable

Details

    Description

      this is JDK-8266969 for TreeCell - to keep scope of the fix bounded by cell type :)

      To summarize (treeCell specifics - copied from the blocked issued):

      The invariant:

          control.edit(editingIndex);
          control.setOnEditCancel(e -> assertEquals(editingIndex, e.getIndex()));

      must be kept independent of what triggered the cancel. For TreeCell, it is broken on cell re-use (detected while fixing JDK-8265210). It's caused by using the current cell location in the event:

           // TreeCell
            editingLocation = this.getTreeItem();
            fire(new XXEvent(...editingLocation...)

      which on re-use is different from the one at the time of starting the edit. Tentative fix is to keep the index (treeItem) at the time of startEdit and use it in the cancelEvent.

      Attachments

        Issue Links

          Activity

            People

              fastegal Jeanette Winzenburg
              fastegal Jeanette Winzenburg
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: