use of com.google.jstestdriver.idea.server.JstdServer 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.JstdServer in project intellij-plugins by JetBrains.
the class JstdServerRestartAction method update.
@Override
public void update(AnActionEvent e) {
JstdServer runningServer = JstdServerRegistry.getInstance().getServer();
Presentation presentation = e.getPresentation();
if (runningServer != null && runningServer.isProcessRunning()) {
presentation.setIcon(AllIcons.Actions.Restart);
presentation.setText("Rerun local server");
} else {
presentation.setIcon(AllIcons.Actions.Execute);
presentation.setText("Start a local server");
}
e.getPresentation().setEnabled(true);
}
use of com.google.jstestdriver.idea.server.JstdServer in project intellij-plugins by JetBrains.
the class JstdServerStopAction method update.
@Override
public void update(AnActionEvent e) {
JstdServer server = JstdServerRegistry.getInstance().getServer();
e.getPresentation().setEnabled(server != null && server.isProcessRunning());
}
use of com.google.jstestdriver.idea.server.JstdServer 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