RFR: 8231644: TreeTableView Regression: Indentation wrong using Label as column content type [v3]

Ajit Ghaisas aghaisas at openjdk.java.net
Mon Sep 27 10:58:18 UTC 2021

On Fri, 24 Sep 2021 16:32:26 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

>> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TreeTableCellSkin.java line 127:
>>> 125:             double leftInset) {
>>> 126:         if (isDeferToParentForPrefWidth) {
>>> 127:             return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset) + calculateIndentation();
>> If we are deferring to Parent for the preferred width, then we need not add indentation. 
>> I think, we should interchange line 127 and line 130.
> No that's actually correct as it is. 
> That is because when a cell is deferred from the parent we want to know the width we need without being truncated. For now that is only set when the auto size of the table is triggered (see also: **TableColumnHeader#resizeColumnToFitContent**). 
> And if not deferred, the width of the cell is in sync with the column (you can also that in the super class -> **super.computePrefWidth(..)**)

OK. Thanks for the explanation.


PR: https://git.openjdk.java.net/jfx/pull/568

More information about the openjfx-dev mailing list