-
Bug
-
Resolution: Unresolved
-
P4
-
9
-
java9-ea-u180
Since fx9, access to tableSkin changed from protected to package-private. Also its accessibility in the headers' life-cycle changed from initially in super constructor (that is very early) to after setting its TableHeaderRow (<aside> wondering why you didn't keep it as a field in TableColumnHeader?</aside>)
The tableSkin is needed in (not only) custom headers to configure themselves from skin/table properties. Core headers now configure themselves in
void setTableHeaderRow(TableHeaderRow thr) {
tableHeaderRow = thr;
updateTableSkin();
}
private void updateTableSkin() {
// when we get the table header row, we are also given the skin,
// so this is the time to hook up listeners, etc.
TableViewSkinBase<?,?,?,?,?> tableSkin = getTableSkin();
if (tableSkin == null) return;
// do config stuff related to skin/table
...
}
TableViewSkinBase<?,?,?,?,?> getTableSkin() {
return tableHeaderRow == null ? null : tableHeaderRow.tableSkin;
}
For custom headers, there is no way to reliably hook into the config: even with deep reflection for accessing the package/private methods, the time as to when the skin is available is not clearly defined (for subs).
The easiest solution (for me as application/framework developer) would be to move those methods into protected scope ...
The tableSkin is needed in (not only) custom headers to configure themselves from skin/table properties. Core headers now configure themselves in
void setTableHeaderRow(TableHeaderRow thr) {
tableHeaderRow = thr;
updateTableSkin();
}
private void updateTableSkin() {
// when we get the table header row, we are also given the skin,
// so this is the time to hook up listeners, etc.
TableViewSkinBase<?,?,?,?,?> tableSkin = getTableSkin();
if (tableSkin == null) return;
// do config stuff related to skin/table
...
}
TableViewSkinBase<?,?,?,?,?> getTableSkin() {
return tableHeaderRow == null ? null : tableHeaderRow.tableSkin;
}
For custom headers, there is no way to reliably hook into the config: even with deep reflection for accessing the package/private methods, the time as to when the skin is available is not clearly defined (for subs).
The easiest solution (for me as application/framework developer) would be to move those methods into protected scope ...
- relates to
-
JDK-8207942 Add new protected VirtualFlow methods for subclassing
- Resolved