-
Notifications
You must be signed in to change notification settings - Fork 460
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
8290863: Update the documentation of Virtualized controls to include the best practice of not using Nodes directly in the item list #995
Conversation
👋 Welcome back aghaisas! A progress list of the required criteria for merging this PR into |
/csr |
/reviewers 2 |
@aghaisas has indicated that a compatibility and specification (CSR) request is needed for this pull request. @aghaisas please create a CSR request for issue JDK-8290863 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
Webrevs
|
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/TreeTableView.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
Instead of repeating this in every class, maybe writing it once in |
Thanks @andy-goryachev-oracle, @kevinrushforth and @nlisker for your review. My responses are inline -
I am convinced that we should avoid writing out the non-recommended code snippet in documentation. I will replace it with bulleted list as suggested.
@kevinrushforth and I did think about this suggestion before deciding to put the warning explicitly in each of the virtualized controls. Each of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have only minor suggestion, the extra space will not make any difference as it won't be seen in the browser.
Will re-approve should you decide to fix them.
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/TableView.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks great. I left a few comments on the wording.
I presume all of the newly added examples compile?
modules/javafx.controls/src/main/java/javafx/scene/control/ComboBox.java
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks great. I left a few comments on the wording.
I presume all of the newly added examples compile?
Yes. They do compile.
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ComboBox.java
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good apart from one more missing "the". Once you add it, go ahead and create the CSR and move it to "Proposed".
modules/javafx.controls/src/main/java/javafx/scene/control/ComboBox.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor inline comments that are relevant for the other classes here as well.
Looking at the current ListView
docs, I think it's not very informative. The main paragraph talks about generics in Java:
A ListView is able to have its generic type set to represent the type of data in the backing model. Doing this has the benefit of making various methods in the ListView, as well as the supporting classes (mentioned below), type-safe. In addition, making use of the generic type supports substantially simplified development of applications making use of ListView, as all modern IDEs are able to auto-complete far more successfully with the additional type information.
I think that all of that should be removed, and your explanation on how to actually use ListView
should be added instead. While it's tied to the "Customizing Visuals" section, the points of ListView
is for it contain data/model instances which are interpreted as a visual Node
by the ListView
, so it should belong in the main paragraph.
I can come up with a redistribution of the paragraphs if you want and if you don't consider this out of scope.
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
Outdated
Show resolved
Hide resolved
This would be better done as a separate follow-up issue. |
@nlisker, Can you please file an issue explaining how exactly you would like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
Yes, I'll probably work on it during RDP 2. It's not the only control I want to go over. |
@aghaisas 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:
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 15 new commits pushed to the
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 |
/integrate |
Going to push as commit 39d8747.
Your commit was automatically rebased without conflicts. |
This PR adds a warning about inserting Nodes directly into the virtualized containers such as ListView, TreeView, TableView and TreeTableView. It also adds code snippets showing the recommended pattern of using a custom cell factory for each of the virtualized control.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/995/head:pull/995
$ git checkout pull/995
Update a local copy of the PR:
$ git checkout pull/995
$ git pull https://git.openjdk.org/jfx pull/995/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 995
View PR using the GUI difftool:
$ git pr show -t 995
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/995.diff