changeset 138:78c10cd8a4f8

RT-18416: [ListView] Shift+PageDown lose selection.
author jgiles
date Fri, 09 Dec 2011 16:44:16 +1000
parents 0d10aa415470
children 0c5ec026b7ad
files javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TableViewBehavior.java javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeViewBehavior.java
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java	Fri Dec 09 16:32:35 2011 +1000
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java	Fri Dec 09 16:44:16 2011 +1000
@@ -523,8 +523,10 @@
         MultipleSelectionModel sm = getControl().getSelectionModel();
         if (sm == null) return;
         
+        selectionChanging = true;
         sm.clearSelection();
         sm.selectRange(leadSelectedIndex, leadIndex + 1);
+        selectionChanging = false;
     }
     
     private void selectAllPageDown() {
@@ -542,8 +544,10 @@
         MultipleSelectionModel sm = getControl().getSelectionModel();
         if (sm == null) return;
         
+        selectionChanging = true;
         sm.clearSelection();
         sm.selectRange(leadIndex, leadSelectedIndex + 1);
+        selectionChanging = false;
     }
 
     private void selectAllToFirstRow() {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TableViewBehavior.java	Fri Dec 09 16:32:35 2011 +1000
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TableViewBehavior.java	Fri Dec 09 16:44:16 2011 +1000
@@ -836,8 +836,10 @@
         TableView.TableViewSelectionModel sm = getControl().getSelectionModel();
         if (sm == null) return;
         
+        selectionChanging = true;
         sm.clearSelection();
         sm.selectRange(leadSelectedIndex, leadIndex + 1);
+        selectionChanging = false;
     }
     
     private void selectAllPageDown() {
@@ -855,8 +857,10 @@
         TableView.TableViewSelectionModel sm = getControl().getSelectionModel();
         if (sm == null) return;
         
+        selectionChanging = true;
         sm.clearSelection();
         sm.selectRange(leadIndex, leadSelectedIndex + 1);
+        selectionChanging = false;
     }
     
     private void toggleFocusOwnerSelection() {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeViewBehavior.java	Fri Dec 09 16:32:35 2011 +1000
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeViewBehavior.java	Fri Dec 09 16:44:16 2011 +1000
@@ -503,8 +503,10 @@
         MultipleSelectionModel sm = getControl().getSelectionModel();
         if (sm == null) return;
         
+        selectionChanging = true;
         sm.clearSelection();
         sm.selectRange(leadSelectedIndex, leadIndex + 1);
+        selectionChanging = false;
     }
     
     private void selectAllPageDown() {
@@ -522,8 +524,10 @@
         MultipleSelectionModel sm = getControl().getSelectionModel();
         if (sm == null) return;
         
+        selectionChanging = true;
         sm.clearSelection();
         sm.selectRange(leadIndex, leadSelectedIndex + 1);
+        selectionChanging = false;
     }
     
     private void selectAllToFocus() {