From df5849355085c1f4feccdb9cda53205d4f3fee2b Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Tue, 10 May 2016 14:00:18 +0200 Subject: [PATCH] Find in Path Dialog: Preview tab does allow F4 to jump to source when focus in code preview pane (lower half) (IDEA-150915) --- .../com/intellij/find/impl/FindDialog.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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); + } }