Skip to content

8187474: Tree-/TableCell, TreeCell: editingCell/Item not updated in cell.startEdit#638

Closed
kleopatra wants to merge 3 commits intoopenjdk:masterfrom
kleopatra:bug-fix-8187474
Closed

8187474: Tree-/TableCell, TreeCell: editingCell/Item not updated in cell.startEdit#638
kleopatra wants to merge 3 commits intoopenjdk:masterfrom
kleopatra:bug-fix-8187474

Conversation

@kleopatra
Copy link
Collaborator

@kleopatra kleopatra commented Oct 5, 2021

cell startEdit is supposed to update the editing location on its associated control - was done in ListCell, not in Tree-/TableCell nor TreeCell.

Fix was to add control.edit(..). Note that ListCell was also touched to use the exact same method call pattern as the fixed cell types.

Added/unignored cell tests that are failing/passing before/after the fix.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8187474: Tree-/TableCell, TreeCell: editingCell/Item not updated in cell.startEdit

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/638/head:pull/638
$ git checkout pull/638

Update a local copy of the PR:
$ git checkout pull/638
$ git pull https://git.openjdk.java.net/jfx pull/638/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 638

View PR using the GUI difftool:
$ git pr show -t 638

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/638.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 5, 2021

👋 Welcome back fastegal! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Ready for review label Oct 5, 2021
@mlbridge
Copy link

mlbridge bot commented Oct 5, 2021

Webrevs

@Maran23
Copy link
Member

Maran23 commented Oct 6, 2021

Interesting, I just saw that it worked before because of the TableCellBehavior (edit method). Does this mean this can be removed from the behaviour in future?

@kleopatra
Copy link
Collaborator Author

Interesting, I just saw that it worked before because of the TableCellBehavior (edit method). Does this mean this can be removed from the behaviour in future?

hmm .. the behavior talks directly to the control (not the cell) by invoking control.edit(...) - which might be a problem (or not, didn't look closely yet - left to later when dealing with with big big edit issue ;)

The issue here is cell.startEdit which must call the control.edit(...) to switch the control into editing, independent on other parties.

@kleopatra
Copy link
Collaborator Author

Interesting, I just saw that it worked before because of the TableCellBehavior (edit method). Does this mean this can be removed from the behaviour in future?

hmm .. the behavior talks directly to the control (not the cell) by invoking control.edit(...) - which might be a problem (or not, didn't look closely yet - left to later when dealing with with big big edit issue ;)

an aside I forgot to mention yesterday: this interference from behavior (triggered by mouseEvents) is one of the major stumbling-blocks in solving the ominous commit-on-focusLost issue - by cancelling an edit.

@Maran23
Copy link
Member

Maran23 commented Oct 7, 2021

Interesting, I just saw that it worked before because of the TableCellBehavior (edit method). Does this mean this can be removed from the behaviour in future?

hmm .. the behavior talks directly to the control (not the cell) by invoking control.edit(...) - which might be a problem (or not, didn't look closely yet - left to later when dealing with with big big edit issue ;)

The issue here is cell.startEdit which must call the control.edit(...) to switch the control into editing, independent on other parties.

Yeah right, just want to share my findings though. :)
The whole behaviour stuff is weird anyway, also given that there is still no way do change the behaviour without accessing the (internal) api.

@Maran23
Copy link
Member

Maran23 commented Oct 7, 2021

And by the way, you know why there is a requestFocus() in List/TreeCell, but not in the other two cells? :)

@kleopatra
Copy link
Collaborator Author

And by the way, you know why there is a requestFocus() in List/TreeCell, but not in the other two cells? :)

plain oversight? or the wrong thing to do, anyway? or having weird side-effects in tabular controls which were evaded by not requesting focus? We'll see the deeper we go in the cleanup quest :)

Copy link
Member

@Maran23 Maran23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just left one minor comment. :)

and removed unused (by this fix) import in same file
setupForEditing();
int editingRow = 1;
cell.updateIndex(editingRow);
TablePosition<?,?> editingCell = new TablePosition<>(table, editingRow, editingColumn);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw you added the space for the <?,?> in line 559 (which I didn't saw 😄) but not here :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

darn .. ;) Thanks

Copy link
Collaborator Author

@kleopatra kleopatra Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm .. I'm all for consistency, so don't mind trying again but ... what is the formatting rule? Searching in controls:

  • wildcard search: <?,?> = 1000+ vs. <?, ?> = 379
  • verbatim: <\?,\?> = 173 vs. <\?, \?> = 98

Looks .. inconclusive .. 😁?

But then, generics tutorial has the space - so the space it will be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. Also standard classes like HashMap, AbstractMap or just Map doesn't have the space. I'm also for consisteny, but don't know which would be 'the best' 😄

Copy link
Member

@Maran23 Maran23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 👍

@openjdk
Copy link

openjdk bot commented Oct 29, 2021

@kleopatra This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8187474: Tree-/TableCell, TreeCell: editingCell/Item not updated in cell.startEdit

Reviewed-by: mhanl, aghaisas

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 10 new commits pushed to the master branch:

  • a947405: 8271091: Missing API docs in UI controls classes
  • e7a106f: 8271090: Missing API docs in scenegraph classes
  • 717cfdc: 8274669: Dialog sometimes ignores max height
  • d244b30: 8275815: OCA link in README.md and CONTRIBUTING.md is broken
  • 28e8684: 8272638: Update copyright header for files modified in 2021
  • 7be0abb: 8274413: FX: Update copyright year in docs, readme files to 2022
  • a118d33: 8236689: macOS 10.15 Catalina: LCD text renders badly
  • d6f78e2: 8275138: WebView: UserAgent string is empty for first request
  • b591912: 8274137: TableView scrollbar/header misaligned when reloading data
  • bb73d43: 8272870: Add convenience factory methods for border and background

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Oct 29, 2021
@kleopatra
Copy link
Collaborator Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 29, 2021

Going to push as commit adcc40d.
Since your change was applied there have been 10 commits pushed to the master branch:

  • a947405: 8271091: Missing API docs in UI controls classes
  • e7a106f: 8271090: Missing API docs in scenegraph classes
  • 717cfdc: 8274669: Dialog sometimes ignores max height
  • d244b30: 8275815: OCA link in README.md and CONTRIBUTING.md is broken
  • 28e8684: 8272638: Update copyright header for files modified in 2021
  • 7be0abb: 8274413: FX: Update copyright year in docs, readme files to 2022
  • a118d33: 8236689: macOS 10.15 Catalina: LCD text renders badly
  • d6f78e2: 8275138: WebView: UserAgent string is empty for first request
  • b591912: 8274137: TableView scrollbar/header misaligned when reloading data
  • bb73d43: 8272870: Add convenience factory methods for border and background

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 29, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated rfr Ready for review labels Oct 29, 2021
@openjdk
Copy link

openjdk bot commented Oct 29, 2021

@kleopatra Pushed as commit adcc40d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@kleopatra kleopatra deleted the bug-fix-8187474 branch October 29, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants