changeset 2122:4323ceace542

RT-23486: TableView does not respect CONSTRAINED_RESIZE_POLICY where columns are reordered
author jgiles
date Thu, 03 Jan 2013 14:47:18 +1300
parents 30898a2b4367
children 30925f13810e
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableViewSkin.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TreeTableViewSkin.java
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableViewSkin.java	Thu Jan 03 14:37:48 2013 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableViewSkin.java	Thu Jan 03 14:47:18 2013 +1300
@@ -247,7 +247,13 @@
             }
         }
         
-        col.impl_setWidth(maxWidth + padding);
+        // RT-23486
+        double widthMax = maxWidth + padding;
+        if(tableView.getColumnResizePolicy() == TableView.CONSTRAINED_RESIZE_POLICY) {
+             widthMax = Math.max(widthMax, col.getWidth());
+        }
+
+        col.impl_setWidth(widthMax); 
     }
     
     /** {@inheritDoc} */
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TreeTableViewSkin.java	Thu Jan 03 14:37:48 2013 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TreeTableViewSkin.java	Thu Jan 03 14:47:18 2013 +1300
@@ -351,7 +351,13 @@
             }
         }
         
-        col.impl_setWidth(maxWidth + padding);
+        // RT-23486
+        double widthMax = maxWidth + padding;
+        if(treeTableView.getColumnResizePolicy() == TreeTableView.CONSTRAINED_RESIZE_POLICY) {
+             widthMax = Math.max(widthMax, col.getWidth());
+        }
+
+        col.impl_setWidth(widthMax); 
     }
     
     /** {@inheritDoc} */