void (final JComponent input, final JComponent affectedComponent, boolean registerOnBothComponents) { final SelectionMover mover = new SelectionMover(affectedComponent); final AnAction up = new UpDownAction(mover, input, true); up.registerCustomShortcutSet(UP_KEY, input); final AnAction down = new UpDownAction(mover, input, false); down.registerCustomShortcutSet(DOWN_KEY, input); if (registerOnBothComponents) { up.registerCustomShortcutSet(UP_KEY, affectedComponent); down.registerCustomShortcutSet(DOWN_KEY, affectedComponent); } }