From 3fb6993989961bad7ef919367736fd5e169edf33 Mon Sep 17 00:00:00 2001 From: andrey zaytsev Date: Thu, 26 May 2011 00:01:03 +0400 Subject: [PATCH] IDEA-70224 Disable 'Find All' button in find toolbar when search string is empty --- .../intellij/find/editorHeaderActions/FindAllAction.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/FindAllAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/FindAllAction.java index e017c0165ca6..672f64438c19 100644 --- a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/FindAllAction.java +++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/FindAllAction.java @@ -7,7 +7,6 @@ import com.intellij.find.FindUtil; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.IdeActions; -import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; @@ -34,9 +33,9 @@ public class FindAllAction extends EditorHeaderAction implements DumbAware { public void update(final AnActionEvent e) { super.update(e); - Project project = e.getData(PlatformDataKeys.PROJECT); - Editor editor = e.getData(PlatformDataKeys.EDITOR); - if (project != null && editor != null) { + Editor editor = getEditorSearchComponent().getEditor(); + Project project = editor.getProject(); + if (project != null) { e.getPresentation().setEnabled(getEditorSearchComponent().hasMatches() && PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()) != null); }