From 2d0dab83357d517991e2a6c7ff9c9124fcd7d043 Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Mon, 12 Nov 2012 15:42:41 +0400 Subject: [PATCH] IDEA-19061 Integrate the Rearranger-plugin into core-IDE Correct multiple selection processing --- .../ArrangementMatchingRulesControl.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesControl.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesControl.java index 94d56d10743e..bf84d873f2b7 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesControl.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesControl.java @@ -234,23 +234,10 @@ public class ArrangementMatchingRulesControl extends JBTable { } if (myEditorRow >= 0) { - if (myEditorRow == selectedRow) { - mySkipSelectionChange = true; - try { - getSelectionModel().setSelectionInterval(myEditorRow - 1, myEditorRow - 1); - } - finally { - mySkipSelectionChange = false; - } - return; - } - else { - hideEditor(); - } + hideEditor(); } // There is a possible case that there was an active editor in a row before the selected. - selectedRow = selectionModel.getMinSelectionIndex(); ArrangementListRowDecorator toEdit = myComponents.get(selectedRow); if (toEdit != null) { showEditor(selectedRow); @@ -266,7 +253,11 @@ public class ArrangementMatchingRulesControl extends JBTable { mySkipSelectionChange = true; try { getModel().removeRow(myEditorRow); - getSelectionModel().clearSelection(); + ListSelectionModel selectionModel = getSelectionModel(); + if (selectionModel.getMinSelectionIndex() == selectionModel.getMaxSelectionIndex()) { + // One row is selected and editor for it is collapsed. + selectionModel.clearSelection(); + } } finally { mySkipSelectionChange = false; @@ -392,8 +383,9 @@ public class ArrangementMatchingRulesControl extends JBTable { @Override public boolean stopCellEditing() { + boolean result = super.stopCellEditing(); myValue = null; - return true; + return result; } }