Can we have TableSkinUtils.resizeColumnToFitContent as public API
fastegal at swingempire.de
fastegal at swingempire.de
Mon Jun 24 13:20:28 UTC 2019
will be possible to implement once
https://bugs.openjdk.java.net/browse/JDK-8207957 is solved.
As the utility class is an abomination, the plan is to move the
autosize functionality into the realm of the skin/header allowing
subclasses to extend the one/or/and/other and expose for application
code as needed.
Zitat von Robert Lichtenberger <r.lichtenberger at gmail.com>:
> At the moment (JavaFX 12) I hack around the fact that TableSkinUtils is not
> public like this:
> Class<?> clz =
> Class.forName("javafx.scene.control.skin.TableSkinUtils");
> Method m = clz.getMethod("resizeColumnToFitContent",
> TableViewSkinBase.class, TableColumnBase.class, int.class);
> m.setAccessible(true);
> m.invoke(null, tc.getTableView().getSkin(), tc, -1);
> which of course is very brittle.
>
> I need this to provide the user with an option to fit all columns to their
> required size.
>
> Double clicking the header separator will call this method so why not
> provide the functionality programatically too?
>
> Best regards,
> Robert
More information about the openjfx-discuss
mailing list