void (KeyEvent e) { if (togglePopup(e)) return; if (!isPopupShowing()) return; InputMap map = myPathTextField.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); if (map != null) { Object object = map.get(KeyStroke.getKeyStrokeForEvent(e)); if (object instanceof Action action) { if (action.isEnabled()) { action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "action")); e.consume(); return; } } } Object action = getAction(e, myList); if (ListActions.Down.ID.equals(action)) { if (ensureSelectionExists()) { ScrollingUtil.moveDown(myList, e.getModifiersEx()); e.consume(); } } else if (ListActions.Up.ID.equals(action)) { ScrollingUtil.moveUp(myList, e.getModifiersEx()); e.consume(); } else if (ListActions.PageDown.ID.equals(action)) { ScrollingUtil.movePageDown(myList); e.consume(); } else if (ListActions.PageUp.ID.equals(action)) { ScrollingUtil.movePageUp(myList); e.consume(); } else if (getSelectedFileFromCompletionPopup() != null && (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_TAB) && e.getModifiersEx() == 0) { hideCurrentPopup(); e.consume(); processChosenFromCompletion(e.getKeyCode() == KeyEvent.VK_TAB); } }