RFR: 8359599: Calling refresh() for all virtualized controls recreates all cells instead of refreshing the cells [v3]
Kevin Rushforth
kcr at openjdk.org
Fri Oct 10 22:37:46 UTC 2025
On Fri, 10 Oct 2025 22:32:17 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableViewSkinBase.java line 305:
>>
>>> 303: return;
>>> 304: }
>>> 305: if (Properties.RECREATE.equals(c.getKey())) {
>>
>> I just have to raise this concern.
>>
>> It looks weird to me to use properties as a roundabout way to invoke a hidden method in the skin. Node properties, a public facility, can be easily mutated by unrelated code, making it easy to break the intended functionality.
>>
>> Why not make these two methods explicitly a part of the public API by replacing `requestRebuildCells` and `requestRecreateCells` with
>>
>>
>> protected VirtualContainerBase.rebuildCells()
>> protected VirtualContainerBase.recreateCells()
>>
>>
>> ?
>>
>> (requestXXX is a misnomer - it might suggest an async nature, whereas it these are synchronous methods)
>
> Changing this is out of scope for this PR.
Having said that, I've always disliked using user properties for this sort of thing. It feels like a bit of a hack, so it might be worth filing a follow-up to evaluate a different approach in general (not just for this one instance of the pattern). I don't see this as a high priority, though.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1830#discussion_r2422200259
More information about the openjfx-dev
mailing list