From 46560e6f4ff8284132e4d55ce9f2bf2f754eb376 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Fri, 3 Mar 2017 23:30:36 +0300 Subject: [PATCH] IDEA-144857 Don't restart result when user changes 'replace' text --- .../com/intellij/find/impl/FindPopupPanel.java | 18 ++++++++---------- .../src/messages/FindBundle.properties | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java b/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java index ee37d5c464d6..a0b293263b86 100644 --- a/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java +++ b/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java @@ -266,10 +266,7 @@ public class FindPopupPanel extends JBPanel implements FindUI { myCbWholeWordsOnly.addItemListener(liveResultsPreviewUpdateListener); myCbRegularExpressions = new StateRestoringCheckBox(FindBundle.message("find.popup.regex")); myCbRegularExpressions.addItemListener(liveResultsPreviewUpdateListener); - myCbFileFilter = new StateRestoringCheckBox("File mask: "); - myCbFileFilter.setMnemonic('a'); - myCbFileFilter.setToolTipText("Use file mask(s)"); - myCbFileFilter.setBorder(null); + myCbFileFilter = new StateRestoringCheckBox(FindBundle.message("find.popup.filemask")); myCbFileFilter.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { @@ -319,7 +316,7 @@ public class FindPopupPanel extends JBPanel implements FindUI { @Override public void actionPerformed(AnActionEvent e) { if (PlatformDataKeys.CONTEXT_COMPONENT.getData(e.getDataContext()) == null) return; - + ListPopup listPopup = JBPopupFactory.getInstance().createActionGroupPopup(null, switchContextGroup, e.getDataContext(), false, null, 10); listPopup.showUnderneathOf(myFilterContextButton); @@ -432,8 +429,9 @@ public class FindPopupPanel extends JBPanel implements FindUI { myReplaceComponent.setRows(Math.max(1, Math.min(3, StringUtil.countChars(myReplaceComponent.getText(), '\n') + 1))); if (myBalloon == null) return; - - scheduleResultsUpdate(); + if (e.getDocument() == mySearchComponent.getDocument()) { + scheduleResultsUpdate(); + } } }; mySearchComponent.getDocument().addDocumentListener(documentAdapter); @@ -669,7 +667,7 @@ public class FindPopupPanel extends JBPanel implements FindUI { add(scopesPanel, "sx 10, pushx, growx, ax left, wrap, gaptop 4, gapbottom 4"); add(splitter, "pushx, growx, growy, pushy, sx 10, wrap, pad 0 -4 0 4"); add(bottomPanel, "pushx, growx, dock south, sx 10, pad 0 -4 0 4"); - + MnemonicHelper.init(this); setFocusCycleRoot(true); } @@ -797,10 +795,10 @@ public class FindPopupPanel extends JBPanel implements FindUI { return Scope.PROJECT; } else if (model.getDirectoryName() != null) { - return Scope.DIRECTORY; + return Scope.DIRECTORY; } else if (model.getModuleName() != null) { - return Scope.MODULE; + return Scope.MODULE; } return Scope.PROJECT; } diff --git a/platform/platform-resources-en/src/messages/FindBundle.properties b/platform/platform-resources-en/src/messages/FindBundle.properties index 10e30c1a5b90..d9e0b6e0660a 100644 --- a/platform/platform-resources-en/src/messages/FindBundle.properties +++ b/platform/platform-resources-en/src/messages/FindBundle.properties @@ -142,6 +142,7 @@ results.options.group=Result options find.popup.case.sensitive=Match &case find.popup.whole.words=Wo&rds find.popup.regex=Re&gex +find.popup.filemask=File m&ask: find.popup.scope.project=In &Project find.popup.scope.module=&Module find.popup.scope.directory=&Directory