use of com.intellij.execution.RunContentExecutor in project intellij-plugins by JetBrains.
the class SendToMayaCommand method run.
public void run() {
try {
final ProcessHandler process = createRunInMayaProcessHandler();
new RunContentExecutor(myProject, process).withTitle(getTitle()).withRerun(() -> this.run()).withStop(() -> process.destroyProcess(), () -> !process.isProcessTerminated()).run();
} catch (ExecutionException e) {
Messages.showErrorDialog(myProject, e.getMessage(), getTitle());
}
}
use of com.intellij.execution.RunContentExecutor in project intellij-community by JetBrains.
the class PythonTask method run.
/**
* @param env environment variables to be passed to process or null if nothing should be passed
* @param consoleView console to run this task on. New console will be used if no console provided.
*/
public void run(@Nullable final Map<String, String> env, @Nullable final ConsoleView consoleView) throws ExecutionException {
final ProcessHandler process = createProcess(env);
final Project project = myModule.getProject();
new RunContentExecutor(project, process).withFilter(new PythonTracebackFilter(project)).withConsole(consoleView).withTitle(myRunTabTitle).withRerun(() -> {
try {
// Stop process before rerunning it
process.destroyProcess();
if (process.waitFor(TIME_TO_WAIT_PROCESS_STOP)) {
this.run(env, consoleView);
} else {
Messages.showErrorDialog(PyBundle.message("unable.to.stop"), myRunTabTitle);
}
} catch (ExecutionException e) {
Messages.showErrorDialog(e.getMessage(), myRunTabTitle);
}
}).withStop(() -> process.destroyProcess(), () -> !process.isProcessTerminated()).withAfterCompletion(myAfterCompletion).withHelpId(myHelpId).run();
}
Aggregations