Find in Path Dialog: Preview tab does allow F4 to jump to source when focus in code preview pane (lower half) (IDEA-150915)

This commit is contained in:
Maxim.Mossienko
2016-05-10 14:01:28 +02:00
parent 36a399c55f
commit df58493550
@@ -644,6 +644,7 @@ public class FindDialog extends DialogWrapper {
}
};
myUsagePreviewPanel.setBorder(IdeBorderFactory.createBorder());
registerNavigateToSourceShortcutOnComponent(table, myUsagePreviewPanel);
myResultsPreviewTable = table;
new TableSpeedSearch(table, new Convertor<Object, String>() {
@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);
}
}