use of com.intellij.execution.runners.RunContentBuilder in project intellij-plugins by JetBrains.
the class FlexRunner method standardLaunch.
@Nullable
private RunContentDescriptor standardLaunch(final Project project, final RunProfileState state, final RunContentDescriptor contentToReuse, final ExecutionEnvironment environment) throws ExecutionException {
final ExecutionResult executionResult = state.execute(environment.getExecutor(), this);
if (executionResult == null)
return null;
final RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, environment);
return contentBuilder.showRunContent(contentToReuse);
}
use of com.intellij.execution.runners.RunContentBuilder in project intellij-plugins by JetBrains.
the class FlexRunner method launchAirFlexUnit.
@Nullable
protected RunContentDescriptor launchAirFlexUnit(final Project project, final RunProfileState state, final RunContentDescriptor contentToReuse, final ExecutionEnvironment env, final FlexUnitRunnerParameters params) throws ExecutionException {
final ExecutionResult executionResult;
final SwfPolicyFileConnection policyFileConnection = new SwfPolicyFileConnection();
policyFileConnection.open(params.getSocketPolicyPort());
final FlexUnitConnection flexUnitConnection = new FlexUnitConnection();
flexUnitConnection.open(params.getPort());
executionResult = state.execute(env.getExecutor(), this);
if (executionResult == null) {
flexUnitConnection.close();
policyFileConnection.close();
return null;
}
flexUnitConnection.addListener(new FlexUnitListener(executionResult.getProcessHandler()));
executionResult.getProcessHandler().addProcessListener(new ProcessAdapter() {
@Override
public void processWillTerminate(ProcessEvent event, boolean willBeDestroyed) {
flexUnitConnection.write("Finish");
}
@Override
public void processTerminated(ProcessEvent event) {
flexUnitConnection.close();
policyFileConnection.close();
}
});
final RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, env);
return contentBuilder.showRunContent(contentToReuse);
}
Aggregations