[jfx20] RFR: 8290863: Update the documentation of Virtualized controls to include the best practice of not using Nodes directly in the item list [v4]
Kevin Rushforth
kcr at openjdk.org
Fri Jan 20 12:44:43 UTC 2023
On Fri, 20 Jan 2023 11:16:04 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:
>> 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.
>
> Ajit Ghaisas has updated the pull request incrementally with one additional commit since the last revision:
>
> Additional review fixes
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 line 147:
> 145: * a custom {@link #cellFactoryProperty() cell factory}.</li>
> 146: * </ul>
> 147: * <p>The following minimal example shows how to create a custom cell factory for {@code ComboBox} containing {@link Node}s:
Can you also add the final note, after the example, about creating the Rectangle in the instance init block or constructor?
modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java line 191:
> 189: * <p> This example has an anonymous custom {@code ListCell} class in the custom cell factory.
> 190: * Note that the {@code Rectangle} ({@code Node}) object needs to be created in the instance initialization block
> 191: * or the constructor of custom {@code ListCell} class and updated/used in its {@code updateItem} method.
of _the_ custom ...
-------------
PR: https://git.openjdk.org/jfx/pull/995
More information about the openjfx-dev
mailing list