use of com.intellij.execution.process.NopProcessHandler in project intellij-plugins by JetBrains.
the class JstdRunProfileState method createProcessHandler.
@NotNull
private ProcessHandler createProcessHandler(@Nullable JstdServer ideServer) throws ExecutionException {
String serverUrl = getServerUrl(ideServer);
if (serverUrl != null) {
return createOSProcessHandler(serverUrl);
}
final NopProcessHandler nopProcessHandler = new NopProcessHandler();
if (ideServer != null) {
ideServer.addLifeCycleListener(new JstdServerLifeCycleAdapter() {
@Override
public void onServerTerminated(int exitCode) {
nopProcessHandler.destroyProcess();
}
}, myEnvironment.getProject());
}
return nopProcessHandler;
}
use of com.intellij.execution.process.NopProcessHandler in project intellij-plugins by JetBrains.
the class JstdCoverageProgramRunner method start.
@Nullable
private static RunContentDescriptor start(@Nullable JstdServer server, @NotNull ExecutionEnvironment environment) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();
JstdRunConfiguration runConfiguration = (JstdRunConfiguration) environment.getRunProfile();
CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
String coverageFilePath = coverageEnabledConfiguration.getCoverageFilePath();
JstdRunProfileState jstdState = new JstdRunProfileState(environment, runConfiguration.getRunSettings(), coverageFilePath);
ExecutionResult executionResult = jstdState.executeWithServer(server);
RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, environment);
final RunContentDescriptor descriptor = contentBuilder.showRunContent(environment.getContentToReuse());
ProcessHandler processHandler = executionResult.getProcessHandler();
if (processHandler instanceof NopProcessHandler) {
if (server != null) {
server.addLifeCycleListener(new JstdServerLifeCycleAdapter() {
@Override
public void onBrowserCaptured(@NotNull JstdBrowserInfo info) {
ExecutionUtil.restartIfActive(descriptor);
server.removeLifeCycleListener(this);
}
}, contentBuilder);
}
} else {
CoverageHelper.attachToProcess(runConfiguration, processHandler, environment.getRunnerSettings());
}
return descriptor;
}
use of com.intellij.execution.process.NopProcessHandler in project intellij-plugins by JetBrains.
the class JstdRunProgramRunner method start.
public static RunContentDescriptor start(@Nullable JstdServer server, boolean fromDebug, @NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();
JstdRunProfileState jstdState = JstdRunProfileState.cast(state);
ExecutionResult executionResult = jstdState.executeWithServer(server);
RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, environment);
final RunContentDescriptor descriptor = contentBuilder.showRunContent(environment.getContentToReuse());
if (server != null && executionResult.getProcessHandler() instanceof NopProcessHandler) {
server.addLifeCycleListener(new JstdServerLifeCycleAdapter() {
@Override
public void onBrowserCaptured(@NotNull JstdBrowserInfo info) {
if (fromDebug) {
final Alarm alarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD, descriptor);
alarm.addRequest(() -> ExecutionUtil.restartIfActive(descriptor), 1000);
} else {
ExecutionUtil.restartIfActive(descriptor);
}
server.removeLifeCycleListener(this);
}
}, contentBuilder);
}
return descriptor;
}
use of com.intellij.execution.process.NopProcessHandler in project intellij-community by JetBrains.
the class DuplexConsoleActionsTest method createConsoleWithReversedActions.
@NotNull
private static ConsoleViewImpl createConsoleWithReversedActions() {
Project project = getProject();
ConsoleViewImpl console = new ConsoleViewImpl(project, GlobalSearchScope.allScope(project), false, false) {
@NotNull
@Override
public AnAction[] createConsoleActions() {
return ContainerUtil.reverse(Arrays.asList(super.createConsoleActions())).toArray(AnAction.EMPTY_ARRAY);
}
};
console.getComponent();
ProcessHandler processHandler = new NopProcessHandler();
processHandler.startNotify();
console.attachToProcess(processHandler);
return console;
}
use of com.intellij.execution.process.NopProcessHandler in project intellij-community by JetBrains.
the class ConsoleViewImplTest method createConsole.
@NotNull
static ConsoleViewImpl createConsole() {
Project project = getProject();
ConsoleViewImpl console = new ConsoleViewImpl(project, GlobalSearchScope.allScope(project), false, false);
// initConsoleEditor()
console.getComponent();
ProcessHandler processHandler = new NopProcessHandler();
processHandler.startNotify();
console.attachToProcess(processHandler);
return console;
}
Aggregations