use of com.google.jstestdriver.idea.server.ui.JstdToolWindowManager in project intellij-plugins by JetBrains.
the class JstdRunProgramRunner method execute.
@NotNull
@Override
protected Promise<RunContentDescriptor> execute(@NotNull ExecutionEnvironment environment, @NotNull RunProfileState state) throws ExecutionException {
JstdRunProfileState jstdState = JstdRunProfileState.cast(state);
if (jstdState.getRunSettings().isExternalServerType()) {
return Promise.resolve(start(null, false, state, environment));
}
JstdToolWindowManager jstdToolWindowManager = JstdToolWindowManager.getInstance(environment.getProject());
jstdToolWindowManager.setAvailable(true);
JstdServer server = JstdServerRegistry.getInstance().getServer();
if (server != null && !server.isStopped()) {
return Promise.resolve(start(server, false, state, environment));
}
return jstdToolWindowManager.restartServer().thenAsync(it -> {
try {
return it == null ? null : Promises.resolvedPromise(start(it, false, state, environment));
} catch (ExecutionException e) {
return Promises.rejectedPromise(e);
}
});
}
use of com.google.jstestdriver.idea.server.ui.JstdToolWindowManager in project intellij-plugins by JetBrains.
the class JstdCoverageProgramRunner method execute.
@NotNull
@Override
protected Promise<RunContentDescriptor> execute(@NotNull ExecutionEnvironment environment, @NotNull RunProfileState state) throws ExecutionException {
if (JstdRunProfileState.cast(state).getRunSettings().isExternalServerType()) {
return Promise.resolve(null);
}
JstdToolWindowManager jstdToolWindowManager = JstdToolWindowManager.getInstance(environment.getProject());
jstdToolWindowManager.setAvailable(true);
JstdServer server = JstdServerRegistry.getInstance().getServer();
if (server != null && !server.isStopped()) {
return Promise.resolve(start(server, environment));
}
return jstdToolWindowManager.restartServer().thenAsync(it -> {
try {
return it == null ? null : Promises.resolvedPromise(start(it, environment));
} catch (ExecutionException e) {
return Promises.rejectedPromise(e);
}
});
}
Aggregations