mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Introduce a factory to create various ProcessHandlers
To be able to move implementations from api to impl, in particular the ColoredProcessHandler.
This commit is contained in:
+5
-5
@@ -16,14 +16,11 @@
|
||||
package com.intellij.execution.configurations;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.process.ColoredProcessHandler;
|
||||
import com.intellij.execution.process.OSProcessHandler;
|
||||
import com.intellij.execution.process.ProcessHandlerFactory;
|
||||
import com.intellij.execution.process.ProcessTerminatedListener;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
public class JavaCommandLineStateUtil {
|
||||
private JavaCommandLineStateUtil() { }
|
||||
|
||||
@@ -34,7 +31,10 @@ public class JavaCommandLineStateUtil {
|
||||
|
||||
@NotNull
|
||||
public static OSProcessHandler startProcess(@NotNull GeneralCommandLine commandLine, boolean ansiColoring) throws ExecutionException {
|
||||
OSProcessHandler processHandler = ansiColoring ? new ColoredProcessHandler(commandLine) : new OSProcessHandler(commandLine);
|
||||
ProcessHandlerFactory factory = ProcessHandlerFactory.getInstance();
|
||||
OSProcessHandler processHandler = ansiColoring ?
|
||||
factory.createColoredProcessHandler(commandLine) :
|
||||
factory.createProcessHandler(commandLine);
|
||||
ProcessTerminatedListener.attach(processHandler);
|
||||
return processHandler;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user