changeset 9385:f1b349874ef0 9-b93

Revert fix for 8134923 due to regression caught during sanity testing Backed out changeset 9cefb201457c
author kcr
date Mon, 16 Nov 2015 12:27:52 -0800
parents 9cefb201457c
children 673f2d582359 88dfc7cae707 742adef43eeb
files modules/controls/src/main/java/javafx/scene/control/MultipleSelectionModelBase.java
diffstat 1 files changed, 18 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/MultipleSelectionModelBase.java	Mon Nov 16 15:13:18 2015 +1300
+++ b/modules/controls/src/main/java/javafx/scene/control/MultipleSelectionModelBase.java	Mon Nov 16 12:27:52 2015 -0800
@@ -27,8 +27,6 @@
 
 import com.sun.javafx.collections.MappingChange;
 import com.sun.javafx.collections.NonIterableChange;
-
-import static javafx.scene.control.SelectionMode.MULTIPLE;
 import static javafx.scene.control.SelectionMode.SINGLE;
 
 import java.util.AbstractList;
@@ -358,28 +356,26 @@
         select(row);
         stopAtomic();
 
-        if (getSelectionMode() == MULTIPLE) {
-            // fire off a single add/remove/replace notification (rather than
-            // individual remove and add notifications) - see RT-33324
-            ListChangeListener.Change<Integer> change;
+        // fire off a single add/remove/replace notification (rather than
+        // individual remove and add notifications) - see RT-33324
+        ListChangeListener.Change<Integer> change;
 
-            /*
-             * getFrom() documentation:
-             *   If wasAdded is true, the interval contains all the values that were added.
-             *   If wasPermutated is true, the interval marks the values that were permutated.
-             *   If wasRemoved is true and wasAdded is false, getFrom() and getTo() should
-             *   return the same number - the place where the removed elements were positioned in the list.
-             */
-            if (wasSelected) {
-                change = ControlUtils.buildClearAndSelectChange(selectedIndicesSeq, previousSelectedIndices, row);
-            } else {
-                int changeIndex = selectedIndicesSeq.indexOf(row);
-                change = new NonIterableChange.GenericAddRemoveChange<>(
-                        changeIndex, changeIndex+1, previousSelectedIndices, selectedIndicesSeq);
-            }
+        /*
+         * getFrom() documentation:
+         *   If wasAdded is true, the interval contains all the values that were added.
+         *   If wasPermutated is true, the interval marks the values that were permutated.
+         *   If wasRemoved is true and wasAdded is false, getFrom() and getTo() should
+         *   return the same number - the place where the removed elements were positioned in the list.
+         */
+        if (wasSelected) {
+            change = ControlUtils.buildClearAndSelectChange(selectedIndicesSeq, previousSelectedIndices, row);
+        } else {
+            int changeIndex = selectedIndicesSeq.indexOf(row);
+            change = new NonIterableChange.GenericAddRemoveChange<>(
+                    changeIndex, changeIndex+1, previousSelectedIndices, selectedIndicesSeq);
+        }
 
-            selectedIndicesSeq.callObservers(change);
-        }
+        selectedIndicesSeq.callObservers(change);
     }
 
     @Override public void select(int row) {