speed search: allow to select items with shift modifiers

This commit is contained in:
Sergey Ignatov
2014-08-27 15:57:24 +04:00
parent f7f9fe285e
commit d3cce01dd9
@@ -298,6 +298,7 @@ public abstract class SpeedSearchBase<Comp extends JComponent> extends SpeedSear
protected void processKeyEvent(KeyEvent e) {
if (e.isAltDown()) return;
if (e.isShiftDown() && isNavigationKey(e.getKeyCode())) return;
if (mySearchPopup != null) {
mySearchPopup.processKeyEvent(e);
return;
@@ -499,6 +500,15 @@ public abstract class SpeedSearchBase<Comp extends JComponent> extends SpeedSear
return keyCode == KeyEvent.VK_HOME || keyCode == KeyEvent.VK_END || keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN;
}
private static boolean isPgUpPgDown(int keyCode) {
return keyCode == KeyEvent.VK_PAGE_UP || keyCode == KeyEvent.VK_PAGE_DOWN;
}
private static boolean isNavigationKey(int keyCode) {
return isPgUpPgDown(keyCode) || isUpDownHomeEnd(keyCode);
}
private void manageSearchPopup(@Nullable SearchPopup searchPopup) {
Project project = null;
if (ApplicationManager.getApplication() != null && !ApplicationManager.getApplication().isDisposed()) {