Search in sources :

Example 1 with DefaultDebugProcessHandler

use of com.intellij.xdebugger.DefaultDebugProcessHandler in project intellij-plugins by JetBrains.

the class FlexRunner method launchWebFlexUnit.

protected RunContentDescriptor launchWebFlexUnit(final Project project, final RunContentDescriptor contentToReuse, final ExecutionEnvironment env, final FlexUnitRunnerParameters params, final String swfFilePath) throws ExecutionException {
    final SwfPolicyFileConnection policyFileConnection = new SwfPolicyFileConnection();
    policyFileConnection.open(params.getSocketPolicyPort());
    final FlexUnitConnection flexUnitConnection = new FlexUnitConnection();
    flexUnitConnection.open(params.getPort());
    final ProcessHandler processHandler = new DefaultDebugProcessHandler() {

        @Override
        protected void destroyProcessImpl() {
            flexUnitConnection.write("Finish");
            flexUnitConnection.close();
            policyFileConnection.close();
            super.destroyProcessImpl();
        }

        @Override
        public boolean detachIsDefault() {
            return false;
        }
    };
    final ExecutionConsole console = createFlexUnitRunnerConsole(project, env, processHandler);
    flexUnitConnection.addListener(new FlexUnitListener(processHandler));
    launchWithSelectedApplication(swfFilePath, params.getLauncherParameters());
    final RunContentBuilder contentBuilder = new RunContentBuilder(new DefaultExecutionResult(console, processHandler), env);
    Disposer.register(project, contentBuilder);
    return contentBuilder.showRunContent(contentToReuse);
}
Also used : SwfPolicyFileConnection(com.intellij.lang.javascript.flex.flexunit.SwfPolicyFileConnection) FlexUnitConnection(com.intellij.lang.javascript.flex.flexunit.FlexUnitConnection) DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) DefaultDebugProcessHandler(com.intellij.xdebugger.DefaultDebugProcessHandler) DefaultDebugProcessHandler(com.intellij.xdebugger.DefaultDebugProcessHandler) ProcessHandler(com.intellij.execution.process.ProcessHandler) ExecutionConsole(com.intellij.execution.ui.ExecutionConsole) RunContentBuilder(com.intellij.execution.runners.RunContentBuilder)

Aggregations

DefaultExecutionResult (com.intellij.execution.DefaultExecutionResult)1 ProcessHandler (com.intellij.execution.process.ProcessHandler)1 RunContentBuilder (com.intellij.execution.runners.RunContentBuilder)1 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)1 FlexUnitConnection (com.intellij.lang.javascript.flex.flexunit.FlexUnitConnection)1 SwfPolicyFileConnection (com.intellij.lang.javascript.flex.flexunit.SwfPolicyFileConnection)1 DefaultDebugProcessHandler (com.intellij.xdebugger.DefaultDebugProcessHandler)1