diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java b/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java index 0ed1020218de..421170a50005 100644 --- a/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java +++ b/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java @@ -644,6 +644,7 @@ public class FindDialog extends DialogWrapper { } }; myUsagePreviewPanel.setBorder(IdeBorderFactory.createBorder()); + registerNavigateToSourceShortcutOnComponent(table, myUsagePreviewPanel); myResultsPreviewTable = table; new TableSpeedSearch(table, new Convertor() { @Override @@ -1753,13 +1754,6 @@ public class FindDialog extends DialogWrapper { super.installOn(c); if (c instanceof JBTable) { - AnAction anAction = new AnAction() { - @Override - public void actionPerformed(AnActionEvent e) { - navigateToSelectedUsage((JBTable)c); - } - }; - String key = "navigate.to.usage"; JComponent component = (JComponent)c; component.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), @@ -1771,9 +1765,19 @@ public class FindDialog extends DialogWrapper { } }); //anAction.registerCustomShortcutSet(CommonShortcuts.ENTER, component); - anAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), component, myDisposable); + registerNavigateToSourceShortcutOnComponent((JBTable)c, component); } } } + + protected void registerNavigateToSourceShortcutOnComponent(@NotNull final JBTable c, JComponent component) { + AnAction anAction = new AnAction() { + @Override + public void actionPerformed(AnActionEvent e) { + navigateToSelectedUsage(c); + } + }; + anAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), component, myDisposable); + } }