AnAction (@NotNull LanguageConsoleView console, @NotNull final Consumer<? super String> executeActionHandler, @NotNull String historyType, @Nullable String historyPersistenceId, @Nullable Condition<? super LanguageConsoleView> enabledCondition) { ConsoleExecuteAction.ConsoleExecuteActionHandler handler = new ConsoleExecuteAction.ConsoleExecuteActionHandler(true) { @Override void doExecute(@NotNull String text, @NotNull LanguageConsoleView consoleView) { executeActionHandler.consume(text); } }; ConsoleExecuteAction action = new ConsoleExecuteAction(console, handler, enabledCondition); action.registerCustomShortcutSet(action.getShortcutSet(), console.getConsoleEditor().getComponent()); new ConsoleHistoryController(new MyConsoleRootType(historyType), historyPersistenceId, console).install(); return action; }