changeset 3820:a92e5afc944b

RT-30825: Can't Reorder Columns in Table
author jgiles
date Fri, 31 May 2013 10:57:00 +1200
parents a1348a50b9ef
children 30e3bcb6c736
files javafx-ui-controls/src/javafx/scene/control/TableColumnBase.java javafx-ui-controls/test/javafx/scene/control/TableColumnTest.java javafx-ui-controls/test/javafx/scene/control/TreeTableColumnTest.java
diffstat 3 files changed, 67 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/javafx/scene/control/TableColumnBase.java	Wed May 29 16:37:39 2013 -0400
+++ b/javafx-ui-controls/src/javafx/scene/control/TableColumnBase.java	Fri May 31 10:57:00 2013 +1200
@@ -506,7 +506,7 @@
      */
     @Deprecated
     public final boolean impl_isReorderable() {
-        return reorderable == null ? false : reorderable.get();
+        return reorderable == null ? true : reorderable.get();
     }
     
     
--- a/javafx-ui-controls/test/javafx/scene/control/TableColumnTest.java	Wed May 29 16:37:39 2013 -0400
+++ b/javafx-ui-controls/test/javafx/scene/control/TableColumnTest.java	Fri May 31 10:57:00 2013 +1200
@@ -716,6 +716,39 @@
     }
 
     /*********************************************************************
+     * Tests for the reorderable property                                *
+     ********************************************************************/
+
+    @Test public void reorderableIsTrueByDefault() {
+        assertTrue(column.impl_isReorderable());
+        assertTrue(column.impl_reorderableProperty().get());
+    }
+
+    @Test public void reorderableCanBeSpecified() {
+        column.impl_setReorderable(false);
+        assertFalse(column.impl_isReorderable());
+        assertFalse(column.impl_reorderableProperty().get());
+    }
+
+    @Test public void reorderablePropertyBeanIsCorrect() {
+        assertSame(column, column.impl_reorderableProperty().getBean());
+    }
+
+    @Test public void reorderablePropertyNameIsCorrect() {
+        assertEquals("reorderable", column.impl_reorderableProperty().getName());
+    }
+
+    @Test public void reorderableCanBeBound() {
+        BooleanProperty other = new SimpleBooleanProperty(false);
+        column.impl_reorderableProperty().bind(other);
+        assertFalse(column.impl_isReorderable());
+        assertFalse(column.impl_reorderableProperty().get());
+        other.set(true);
+        assertTrue(column.impl_isReorderable());
+        assertTrue(column.impl_reorderableProperty().get());
+    }
+
+    /*********************************************************************
      * Tests for the comparator property                                 *
      ********************************************************************/
 
--- a/javafx-ui-controls/test/javafx/scene/control/TreeTableColumnTest.java	Wed May 29 16:37:39 2013 -0400
+++ b/javafx-ui-controls/test/javafx/scene/control/TreeTableColumnTest.java	Fri May 31 10:57:00 2013 +1200
@@ -720,6 +720,39 @@
     }
 
     /*********************************************************************
+     * Tests for the reorderable property                                *
+     ********************************************************************/
+
+    @Test public void reorderableIsTrueByDefault() {
+        assertTrue(column.impl_isReorderable());
+        assertTrue(column.impl_reorderableProperty().get());
+    }
+
+    @Test public void reorderableCanBeSpecified() {
+        column.impl_setReorderable(false);
+        assertFalse(column.impl_isReorderable());
+        assertFalse(column.impl_reorderableProperty().get());
+    }
+
+    @Test public void reorderablePropertyBeanIsCorrect() {
+        assertSame(column, column.impl_reorderableProperty().getBean());
+    }
+
+    @Test public void reorderablePropertyNameIsCorrect() {
+        assertEquals("reorderable", column.impl_reorderableProperty().getName());
+    }
+
+    @Test public void reorderableCanBeBound() {
+        BooleanProperty other = new SimpleBooleanProperty(false);
+        column.impl_reorderableProperty().bind(other);
+        assertFalse(column.impl_isReorderable());
+        assertFalse(column.impl_reorderableProperty().get());
+        other.set(true);
+        assertTrue(column.impl_isReorderable());
+        assertTrue(column.impl_reorderableProperty().get());
+    }
+
+    /*********************************************************************
      * Tests for the comparator property                                 *
      ********************************************************************/