RFR: 8251480: TableColumnHeader: calc of cell width must respect row styling
Robert Lichtenberger
rlichten at openjdk.java.net
Thu Mar 24 05:01:07 UTC 2022
On Wed, 23 Mar 2022 08:19:41 GMT, Marius Hanl <mhanl at openjdk.org> wrote:
>> This fix respects a row factory, if present.
>> It will put the cell that is used to measure the column width as child below the row.
>> In that way the row's style will be used.
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableColumnHeader.java line 650:
>
>> 648: }
>> 649: Callback<TableView<T>, TableRow<T>> rowFactory = tv.getRowFactory();
>> 650: TableRow<T> tableRow = rowFactory != null ? rowFactory.call(tv) : new TableRow<>();
>
> When there is no row factory, we probably should just return like in line 632-633?
Unlike cell factory, which always has to be present, the row factory is optional and in fact most tables will not have a row factory. If we return in that case, the algorithm will no longer work for these tables.
Compare with `javafx.scene.control.skin.TableViewSkin.createCell()`.
-------------
PR: https://git.openjdk.java.net/jfx/pull/757
More information about the openjfx-dev
mailing list