mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-120952
This commit is contained in:
@@ -44,6 +44,21 @@ public class ConsoleExecuteAction extends DumbAwareAction {
|
||||
this(console, executeActionHandler, CONSOLE_EXECUTE_ACTION_ID, Conditions.<LanguageConsoleImpl>alwaysTrue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Only internal usage, to keep backward compatibility
|
||||
* to remove in IDEA 14
|
||||
*/
|
||||
public static ConsoleExecuteAction createAction(final LanguageConsoleImpl languageConsole,
|
||||
@Nullable Condition<LanguageConsoleImpl> enabledCondition,
|
||||
final BaseConsoleExecuteActionHandler consoleExecuteActionHandler) {
|
||||
return new ConsoleExecuteAction(languageConsole, new ConsoleExecuteActionHandler(consoleExecuteActionHandler.myPreserveMarkup) {
|
||||
@Override
|
||||
void doExecute(@NotNull String text, @NotNull LanguageConsoleImpl console, @Nullable LanguageConsoleView consoleView) {
|
||||
consoleExecuteActionHandler.doExecute(text, languageConsole, null);
|
||||
}
|
||||
}, enabledCondition);
|
||||
}
|
||||
|
||||
ConsoleExecuteAction(@NotNull LanguageConsoleImpl console, final @NotNull ConsoleExecuteActionHandler executeActionHandler, @Nullable Condition<LanguageConsoleImpl> enabledCondition) {
|
||||
this(console, null, executeActionHandler, CONSOLE_EXECUTE_ACTION_ID, enabledCondition);
|
||||
}
|
||||
@@ -97,7 +112,7 @@ public class ConsoleExecuteAction extends DumbAwareAction {
|
||||
private final ConsoleHistoryModel myConsoleHistoryModel;
|
||||
|
||||
private boolean myAddToHistory = true;
|
||||
private final boolean myPreserveMarkup;
|
||||
final boolean myPreserveMarkup;
|
||||
|
||||
public ConsoleExecuteActionHandler(boolean preserveMarkup) {
|
||||
myConsoleHistoryModel = new ConsoleHistoryModel();
|
||||
|
||||
+14
-3
@@ -241,13 +241,24 @@ public abstract class AbstractConsoleRunnerWithHistory<T extends LanguageConsole
|
||||
return myConsoleView.getConsole();
|
||||
}
|
||||
|
||||
public static AnAction createConsoleExecAction(final LanguageConsoleView console,
|
||||
final ProcessHandler processHandler,
|
||||
final ConsoleExecuteActionHandler consoleExecuteActionHandler) {
|
||||
public static AnAction createConsoleExecAction(@NotNull LanguageConsoleView console,
|
||||
@NotNull ProcessHandler processHandler,
|
||||
@NotNull ConsoleExecuteActionHandler consoleExecuteActionHandler) {
|
||||
return new ConsoleExecuteAction(console, consoleExecuteActionHandler, consoleExecuteActionHandler.getEmptyExecuteAction(),
|
||||
new LanguageConsoleBuilder.ProcessBackedExecutionEnabledCondition(processHandler));
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
@Deprecated
|
||||
/**
|
||||
* @deprecated to remove in IDEA 14
|
||||
*/
|
||||
public static AnAction createConsoleExecAction(LanguageConsoleImpl languageConsole,
|
||||
ProcessHandler processHandler,
|
||||
ConsoleExecuteActionHandler consoleExecuteActionHandler) {
|
||||
return ConsoleExecuteAction.createAction(languageConsole, new LanguageConsoleBuilder.ProcessBackedExecutionEnabledCondition(processHandler), consoleExecuteActionHandler);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected abstract ConsoleExecuteActionHandler createConsoleExecuteActionHandler();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user