void () { myResultsList.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { onMouseClicked(e); } }); DumbAwareAction.create(e -> RunAnythingUtil.jumpNextGroup(true, myResultsList)) .registerCustomShortcutSet(CustomShortcutSet.fromString("TAB"), mySearchField, this); DumbAwareAction.create(e -> RunAnythingUtil.jumpNextGroup(false, myResultsList)) .registerCustomShortcutSet(CustomShortcutSet.fromString("shift TAB"), mySearchField, this); AnAction escape = ActionManager.getInstance().getAction("EditorEscape"); DumbAwareAction.create(__ -> { triggerUsed(); searchFinishedHandler.run(); }).registerCustomShortcutSet(escape == null ? CommonShortcuts.ESCAPE : escape.getShortcutSet(), this); DumbAwareAction.create(e -> executeCommand()) .registerCustomShortcutSet( CustomShortcutSet.fromString("ENTER", "shift ENTER", "alt ENTER", "alt shift ENTER", "meta ENTER"), mySearchField, this); DumbAwareAction.create(e -> { RunAnythingSearchListModel model = getSearchingModel(myResultsList); if (model == null) return; Object selectedValue = myResultsList.getSelectedValue(); int index = myResultsList.getSelectedIndex(); if (!(selectedValue instanceof RunAnythingItem) || isMoreItem(index)) return; RunAnythingCache.getInstance(getProject()).getState().getCommands().remove(((RunAnythingItem)selectedValue).getCommand()); model.remove(index); model.shiftIndexes(index, -1); if (!model.isEmpty()) ScrollingUtil.selectItem(myResultsList, index < model.getSize() ? index : index - 1); }).registerCustomShortcutSet(CustomShortcutSet.fromString("shift BACK_SPACE"), mySearchField, this); myProject.getMessageBus().connect(this).subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() { @Override public void exitDumbMode() { ApplicationManager.getApplication().invokeLater(() -> rebuildList()); } }); }