From 6dcb6d64b0c0faa00338656ca494a80ad7d71ac7 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 21 Feb 2012 17:48:15 +0100 Subject: [PATCH] make second show usages take the same usage target, and not something from the first found result --- .../com/intellij/find/actions/ShowUsagesAction.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java index 0fa5a5592674..df92c28ff1cb 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java +++ b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java @@ -31,6 +31,7 @@ import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorLocation; import com.intellij.openapi.fileEditor.TextEditor; import com.intellij.openapi.keymap.KeymapUtil; +import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.ui.popup.JBPopup; @@ -468,23 +469,23 @@ public class ShowUsagesAction extends AnAction implements PopupAction { KeyboardShortcut shortcut = getSettingsShortcut(); if (shortcut != null) { - builder.registerKeyboardAction(shortcut.getFirstKeyStroke(), new ActionListener() { + new DumbAwareAction() { @Override - public void actionPerformed(ActionEvent e) { + public void actionPerformed(AnActionEvent e) { popup[0].cancel(); showDialogAndFindUsages(handler, popupPosition, editor, maxUsages); } - }); + }.registerCustomShortcutSet(new CustomShortcutSet(shortcut.getFirstKeyStroke()), table); } shortcut = getShowUsagesShortcut(); if (shortcut != null) { - builder.registerKeyboardAction(shortcut.getFirstKeyStroke(), new ActionListener() { + new DumbAwareAction() { @Override - public void actionPerformed(ActionEvent e) { + public void actionPerformed(AnActionEvent e) { popup[0].cancel(); searchEverywhere(options, handler, editor, popupPosition, maxUsages); } - }); + }.registerCustomShortcutSet(new CustomShortcutSet(shortcut.getFirstKeyStroke()), table); } InplaceButton button = createSettingsButton(handler, popupPosition, editor, maxUsages, new Runnable() {