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

8277000: Tree-/TableRowSkin: replace listener to fixedCellSize by live lookup #1645

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Maran23
Copy link
Member

@Maran23 Maran23 commented Nov 22, 2024

This PR improves the Tree-/TableRowSkin code by doing a normal live lookup for the fixedCellSize instead of adding listener just to update variables(fixedCellSizeEnabled and fixedCellSize) which can otherwise be also just lookup'd without the hassle of listeners.

While this is mostly a cleanup, it does improve the state of the Tree-/TableRow, as when the TableRowSkinBase constructor is called, the variables are not yet set.

It is also consistent with the other cells, see also JDK-8246745.
Helps a bit with JDK-8185887 (#1644), but as written above, not required as there is no (visible) effect.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8277000: Tree-/TableRowSkin: replace listener to fixedCellSize by live lookup (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1645/head:pull/1645
$ git checkout pull/1645

Update a local copy of the PR:
$ git checkout pull/1645
$ git pull https://git.openjdk.org/jfx.git pull/1645/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1645

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1645.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 22, 2024

👋 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
Copy link

openjdk bot commented Nov 22, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Ready for review label Nov 22, 2024
@@ -97,10 +97,6 @@ public TreeTableRowSkin(TreeTableRow<T> control) {

ListenerHelper lh = ListenerHelper.get(this);

lh.addChangeListener(control.indexProperty(), (ev) -> {
Copy link
Member Author

Choose a reason for hiding this comment

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

Since #1635 got merged, this is not needed as TableRowSkinBase does that already:
registerChangeListener(control.indexProperty(), e -> requestCellUpdate());. So this is basically a noop.

@mlbridge
Copy link

mlbridge bot commented Nov 22, 2024

Webrevs

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Nov 22, 2024

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

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

Tested with the Monkey Tester, both TreeTableView and TableView - looks good, responds to fixed cell size changes.

Left a few minor comments.

// TableCells in the scenegraph
getChildren().remove(tableCell);
}
// we only add/remove to the scenegraph if the fixed cell
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure this is correct?
the tableCell is added in L343 only if fixedCellSize > 0
the removal in L424 misses that logic

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, IntelliJ actually gave me the hint.
isVisible can only be false, when a fixedCellSize is set. So the else branch can only ever be executed when fixedCellSize > 0

Copy link
Contributor

Choose a reason for hiding this comment

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

it's hard to tell (for me): there are just too many conditions: isColumnParticallyOrFullVisible(), if parent == null...

Copy link
Member Author

@Maran23 Maran23 Dec 10, 2024

Choose a reason for hiding this comment

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

It will be much better after #1644 :)

Copy link
Contributor

Choose a reason for hiding this comment

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

can you apply the same treatment as in #1644? there at least it makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would say, lets merge #1644 first and then it is automatically there when the conflict is solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfr Ready for review
Development

Successfully merging this pull request may close these issues.

3 participants