When using a custom constrained resize policy in a TableView/TreeTableView control, after JDK-8293119, that extends ConstrainedColumnResizeBase and implements Callback<TableView.ResizeFeatures, Boolean> (like com.sun.javafx.scene.control.ConstrainedColumnResize.TablePolicy), if the user starts a drag event to resize a column header, there is a call from TableSkinUtils::resizeColumn (coming from NestedTableColumnHeader::columnResizing, from the rectMouseDragged event handler) and the policy can use the passed TableView.ResizeFeatures value to perform any needed calculation, as expected.
However, when the drag event ends, the rectMouseReleased event handler calls NestedTableColumnHeader::columnResizingComplete, which does not call TableSkinUtils::resizeColumn, and therefore, the custom policy doesn't get informed that the drag event ended.
This information could be needed in some occasions, should the developer need to make some calculations based on the deltas received from the TableView.ResizeFeatures value, for instance, during the drag event.
As the delta values are absolute in terms of variance from the original width of the column header, which doesn't change during the drag event, if this width is used for any calculation, it needs to be reset when the drag event ends.
So far, there is no way of knowing when this happens.
However, when the drag event ends, the rectMouseReleased event handler calls NestedTableColumnHeader::columnResizingComplete, which does not call TableSkinUtils::resizeColumn, and therefore, the custom policy doesn't get informed that the drag event ended.
This information could be needed in some occasions, should the developer need to make some calculations based on the deltas received from the TableView.ResizeFeatures value, for instance, during the drag event.
As the delta values are absolute in terms of variance from the original width of the column header, which doesn't change during the drag event, if this width is used for any calculation, it needs to be reset when the drag event ends.
So far, there is no way of knowing when this happens.
- relates to
-
JDK-8329225 Tree/TableView: improve javadoc for column resize policy property
-
- Open
-