void (@NotNull final ConsoleWithProcess consoleWithProcess, @Nullable final JComponent actionListenerComponent, @NotNull final String title, @NotNull final Project project, @NotNull Icon icon, @Nullable final Collection<? extends Runnable> closeListeners, final AnAction @NotNull ... customActions) { final ConsoleStopProcessAction stopProcessAction = new ConsoleStopProcessAction(consoleWithProcess); // Add "stop action" as action and as close listener to stop process when console is closing final Collection<Runnable> resultCloseListeners = new ArrayList<>(Collections.singleton(stopProcessAction)); if (closeListeners != null) { resultCloseListeners.addAll(closeListeners); } final AnAction[] resultActions = ArrayUtil.mergeArrays(new AnAction[]{stopProcessAction}, customActions); showConsole(consoleWithProcess, actionListenerComponent, title, project, icon, resultCloseListeners, resultActions); }