ctrl+enter should execute in groovy shell, not just enter

This commit is contained in:
peter
2012-02-15 19:09:30 +01:00
parent c917d9f3ba
commit 06e4621633
4 changed files with 18 additions and 3 deletions
@@ -255,7 +255,6 @@ public abstract class AbstractConsoleRunnerWithHistory<T extends LanguageConsole
public static class ConsoleExecuteAction extends DumbAwareAction {
public static final String ACTIONS_EXECUTE_ICON = "/actions/execute.png";
public static final String CONSOLE_EXECUTE = "Console.Execute";
private final LanguageConsoleImpl myLanguageConsole;
private final ProcessHandler myProcessHandler;
@@ -270,7 +269,7 @@ public abstract class AbstractConsoleRunnerWithHistory<T extends LanguageConsole
myLanguageConsole = languageConsole;
myProcessHandler = processHandler;
myConsoleExecuteActionHandler = consoleExecuteActionHandler;
EmptyAction.setupAction(this, CONSOLE_EXECUTE, null);
EmptyAction.setupAction(this, consoleExecuteActionHandler.getEmptyExecuteAction(), null);
}
public void actionPerformed(final AnActionEvent e) {
@@ -90,4 +90,8 @@ public class ConsoleExecuteActionHandler {
public void finishExecution() {
}
public String getEmptyExecuteAction() {
return "Console.Execute";
}
}
+4
View File
@@ -1014,6 +1014,10 @@
</extensions>
<actions>
<action id="Groovy.Shell.Execute" class="com.intellij.openapi.actionSystem.EmptyAction" text="Execute Groovy Code" description="Execute Groovy code in console">
<keyboard-shortcut first-keystroke="control ENTER" keymap="$default"/>
</action>
<action id="Groovy.NewClass" class="org.jetbrains.plugins.groovy.actions.NewGroovyClassAction"
text="Groovy Class" description="Create new Groovy class">
<add-to-group group-id="NewGroup" anchor="after" relative-to-action="NewGroup1"/>
@@ -31,7 +31,10 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.*;
import com.intellij.openapi.projectRoots.JavaSdkType;
import com.intellij.openapi.projectRoots.JdkUtil;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.projectRoots.SdkType;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ui.configuration.ModulesAlphaComparator;
import com.intellij.openapi.ui.popup.JBPopupFactory;
@@ -186,6 +189,11 @@ public class GroovyShellAction extends DumbAwareAction {
public void processLine(String line) {
super.processLine(StringUtil.replace(line, "\n", "###\\n"));
}
@Override
public String getEmptyExecuteAction() {
return "Groovy.Shell.Execute";
}
};
new ConsoleHistoryController("Groovy Shell", null, getLanguageConsole(), handler.getConsoleHistoryModel()).install();
return handler;