JDK-8292810 : ☂ CONSTRAINED_RESIZE_POLICY issues
  • Type: Task
  • Component: javafx
  • Sub-Component: other
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-08-23
  • Updated: 2022-10-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Relates :  
Description
The current CONSTRAINED_RESIZE_POLICY has a number of issues, resulting in a number of bugs:

1. generally ignores preferred column widths JDK-8091269
2. unexpectedly displays horizontal scroll bar when the minimum width is set, despite a recent fix by JDK-8089009 (the expected behavior is never to show the HSB, clipping the columns, similar to JTable)
3. fails to resize when the tree/table is empty JDK-8137244, JDK-8130747 
4. fails to resize when the user adjusts columns manually
5. exhibits weird behavior when a minimum width is set and the horizontal scrolling is involved JDK-8089456
6. resizing a column for which min and max widths are set to the same value produces unexpected behavior
7. Tree/TableView.CONSTRAINED_RESIZE_POLICY is static, which means .isFirstRun field is a singleton! (this must be JDK-8088010)


More importantly, the current design makes it impossible for developers to implement their own version of a column resize policy because of:

1. Tree/TableView.contentWidth is private
2. TableColumnBase.doSetWidth() is package protected
3. TableHeader tests for == CONSTRAINED_RESIZE_POLICY (lines 684, 779) or, put in other words, it is simply impossible to communicate to the Tree/TableView that a particular (custom) resize policy is a constrained one.