List of usage examples for com.intellij.openapi.actionSystem IdeActions ACTION_STOP_PROGRAM
String ACTION_STOP_PROGRAM
To view the source code for com.intellij.openapi.actionSystem IdeActions ACTION_STOP_PROGRAM.
Click Source Link
From source file:org.jetbrains.plugins.ruby.ruby.run.ConsoleRunner.java
License:Apache License
private void init() { // add holder created final String[] command = myArgumentsProvider.getArguments(); myProcessHandler = ColouredCommandLineState .createOSProcessHandler(Runner.createProcess(myWorkingDir, command), toCommandLine(command)); if (myProcessListener != null) { myProcessHandler.addProcessListener(myProcessListener); }//from w w w .jav a 2 s. c o m // consoleview creating ConsoleView myConsoleView = TextConsoleBuilderFactory.getInstance().createBuilder(myProject).getConsole(); myConsoleView.setHelpId(myConsoleTitle); // add stacktrace filter.(extends default filter) myConsoleView.addMessageFilter(new RStackTraceFilter(myProject, myWorkingDir)); if (myConsoleFilters != null) { // add other filters for (Filter filter : myConsoleFilters) { myConsoleView.addMessageFilter(filter); } } myConsoleView.attachToProcess(myProcessHandler); // Runner creating final Executor defaultRunner = ExecutorRegistry.getInstance() .getExecutorById(DefaultRunExecutor.EXECUTOR_ID); final DefaultActionGroup toolbarActions = new DefaultActionGroup(); final DefaultActionGroup userActions = new DefaultActionGroup(); //run content desciptor factory final RunContentDescriptorFactory factory = myDescriptorFactory == null ? RunContentDescriptorFactory.DEFAULT : myDescriptorFactory; final RunContentDescriptor myDescriptor = factory.createDesc(myConsoleView, myProcessHandler, new ConsolePanel(myConsoleView, toolbarActions, userActions), myConsoleTitle); // adding actions //user actions if (myUserActions != null) { for (AnAction userAction : myUserActions) { userActions.add(userAction); } } //rerun final Runnable rerun = new Runnable() { @Override public void run() { //Remove obsolete listener if (myProcessListener != null) { myProcessHandler.removeProcessListener(myProcessListener); } //Start new add init(); startProcess(true);//todo } }; toolbarActions.add(new RerunAction(myConsoleView, rerun)); //stop toolbarActions.add(ActionManager.getInstance().getAction(IdeActions.ACTION_STOP_PROGRAM)); //cmd line arguments toolbarActions.add(new ShowCmdLine()); //close toolbarActions.add(new CloseAction(defaultRunner, myDescriptor, myProject)); // showing run content ExecutionManager.getInstance(myProject).getContentManager().showRunContent(defaultRunner, myDescriptor); }