Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8252238: TableView: Editable (pseudo-editable) cells should respect the row editability #529

Closed
wants to merge 2 commits into from

Conversation

@Maran23
Copy link
Member

@Maran23 Maran23 commented Jun 6, 2021

This PR enables Tree- and TableCells to also check the row editability when an edit should happen. With this a Tree- or TableCell is not editable, when the row where the cell is in is not.

While this PR fixes the problem described in the ticket, it does not fix the example.
This is due the example uses the CheckBoxTableCell, which is a ready-to-use subclass of TableCell.

While looking into this, I found out that multiple sub implementations still have this issue, but the fix is not always the same, e.g. CheckBoxTableCell should disable the CheckBox (in updateItem), while the ChoiceBoxTableCell should check the row editability in the startEdit method (like this PR does).

I created a follow-up issues for fixing all the sub Tree- and TableCell implementation which do not count the row editability in:
JDK-8268295


Progress

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

Issue

  • JDK-8252238: TableView: Editable (pseudo-editable) cells should respect the row editability

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 529

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 6, 2021

👋 Welcome back mhanl! 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 label Jun 6, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 6, 2021

Webrevs

@kevinrushforth kevinrushforth requested a review from aghaisas Jun 8, 2021
Copy link
Collaborator

@kleopatra kleopatra left a comment

fix looks good, verified new tests failing before and all tests passing after

left minor comments to the test methods

@kleopatra
Copy link
Collaborator

@kleopatra kleopatra commented Jun 18, 2021

I created a follow-up issues for fixing all the sub Tree- and TableCell implementation which do not count the row editability in:
JDK-8268295

as already commented in the follow-up - I think that it will not be needed after fixing the precondition violation (there are none for any of the cell.xxEdit methods, so the concrete classes must not introduce any) JDK-8188026. The impl pattern will be something like

public void startEdit() {
     if (isEditing()) return;
     super.startEdit();
     if (!isEditing()) return;
     // config edit state
} 

Thus row editable will already be taking into account by super.

@Maran23
Copy link
Member Author

@Maran23 Maran23 commented Jun 22, 2021

I created a follow-up issues for fixing all the sub Tree- and TableCell implementation which do not count the row editability in:
JDK-8268295

as already commented in the follow-up - I think that it will not be needed after fixing the precondition violation (there are none for any of the cell.xxEdit methods, so the concrete classes must not introduce any) JDK-8188026. The impl pattern will be something like

public void startEdit() {
     if (isEditing()) return;
     super.startEdit();
     if (!isEditing()) return;
     // config edit state
} 

Thus row editable will already be taking into account by super.

I like this idea. Then only the CheckBox...Cell implementations needs to be adjusted. :)

@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@Maran23 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:

8252238: TableView: Editable (pseudo-editable) cells should respect the row editability

Reviewed-by: fastegal, 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 8 new commits pushed to the master branch:

  • 04493e5: 8165214: ListView.EditEvent.getIndex() does not return the correct index
  • 13cffba: 8269026: PasswordField doesn't render bullet character on Android
  • 171e484: 8267551: Support loading images from inline data-URIs
  • 98138c8: 8268219: hlsprogressbuffer should provide PTS after GStreamer update
  • c81a722: 8264139: Suppress removal warnings for Security Manager methods
  • 0ffa8e2: 8244075: Accelerator of ContextMenu's MenuItem is not removed when ContextMenu is removed from Scene
  • e6cf1df: 8267094: TreeCell: cancelEvent must return correct editing location
  • ca25036: 8267858: Document that title property in WebEngine gets updated asynchronously

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kleopatra, @aghaisas) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Jun 23, 2021
@Maran23
Copy link
Member Author

@Maran23 Maran23 commented Jun 23, 2021

/integrate

@openjdk openjdk bot added the sponsor label Jun 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@Maran23
Your change (at version e35bf49) is now ready to be sponsored by a Committer.

@aghaisas
Copy link
Collaborator

@aghaisas aghaisas commented Jun 23, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

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

  • 04493e5: 8165214: ListView.EditEvent.getIndex() does not return the correct index
  • 13cffba: 8269026: PasswordField doesn't render bullet character on Android
  • 171e484: 8267551: Support loading images from inline data-URIs
  • 98138c8: 8268219: hlsprogressbuffer should provide PTS after GStreamer update
  • c81a722: 8264139: Suppress removal warnings for Security Manager methods
  • 0ffa8e2: 8244075: Accelerator of ContextMenu's MenuItem is not removed when ContextMenu is removed from Scene
  • e6cf1df: 8267094: TreeCell: cancelEvent must return correct editing location
  • ca25036: 8267858: Document that title property in WebEngine gets updated asynchronously

Your commit was automatically rebased without conflicts.

@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@aghaisas @Maran23 Pushed as commit 45786ac.

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

@Maran23 Maran23 deleted the JDK-8252238 branch Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants