当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionResult类代码示例

本文整理汇总了Java中com.intellij.execution.ExecutionResult的典型用法代码示例。如果您正苦于以下问题:Java ExecutionResult类的具体用法?Java ExecutionResult怎么用?Java ExecutionResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExecutionResult类属于com.intellij.execution包,在下文中一共展示了ExecutionResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attachVirtualMachine

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Nullable
protected RunContentDescriptor attachVirtualMachine(final RunProfileState state, final @NotNull ExecutionEnvironment env)
        throws ExecutionException
{

    return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter()
    {
        @NotNull
        public XDebugProcess start(@NotNull XDebugSession session) throws ExecutionException
        {
            WeaveRunnerCommandLine weaveRunnerCommandLine = (WeaveRunnerCommandLine) state;
            final String weaveFile = weaveRunnerCommandLine.getModel().getWeaveFile();
            final Project project = weaveRunnerCommandLine.getEnvironment().getProject();
            final VirtualFile projectFile = project.getBaseDir();
            final String path = project.getBasePath();
            final String relativePath = weaveFile.substring(path.length());
            final VirtualFile fileByRelativePath = projectFile.findFileByRelativePath(relativePath);
            final DebuggerClient localhost = new DebuggerClient(new WeaveDebuggerClientListener(session, fileByRelativePath), new TcpClientDebuggerProtocol("localhost", 6565));
            final ExecutionResult result = state.execute(env.getExecutor(), WeaveDebuggerRunner.this);
            new DebuggerConnector(localhost).start();
            return new WeaveDebugProcess(session, localhost, result);
        }
    }).getRunContentDescriptor();

}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:26,代码来源:WeaveDebuggerRunner.java

示例2: addDefaultActions

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
private static void addDefaultActions(@NotNull RunContentBuilder contentBuilder, @NotNull ExecutionResult executionResult) {
  final ExecutionConsole executionConsole = executionResult.getExecutionConsole();
  final JComponent consoleComponent = executionConsole != null ? executionConsole.getComponent() : null;
  final ControlBreakAction controlBreakAction = new ControlBreakAction(executionResult.getProcessHandler());
  if (consoleComponent != null) {
    controlBreakAction.registerCustomShortcutSet(controlBreakAction.getShortcutSet(), consoleComponent);
    final ProcessHandler processHandler = executionResult.getProcessHandler();
    assert processHandler != null : executionResult;
    processHandler.addProcessListener(new ProcessAdapter() {
      @Override
      public void processTerminated(final ProcessEvent event) {
        processHandler.removeProcessListener(this);
        controlBreakAction.unregisterCustomShortcutSet(consoleComponent);
      }
    });
  }
  contentBuilder.addAction(controlBreakAction);
  contentBuilder.addAction(new SoftExitAction(executionResult.getProcessHandler()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DefaultJavaProgramRunner.java

示例3: execute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
  final ServerConnection connection = ServerConnectionManager.getInstance().getOrCreateConnection(myServer);
  final Project project = myEnvironment.getProject();
  RemoteServersView.getInstance(project).showServerConnection(connection);

  final DebugConnector<?,?> debugConnector;
  if (DefaultDebugExecutor.getDebugExecutorInstance().equals(executor)) {
    debugConnector = myServer.getType().createDebugConnector();
  }
  else {
    debugConnector = null;
  }
  connection.deploy(new DeploymentTaskImpl(mySource, myConfiguration, project, debugConnector, myEnvironment),
                    new ParameterizedRunnable<String>() {
                      @Override
                      public void run(String s) {
                        RemoteServersView.getInstance(project).showDeployment(connection, s);
                      }
                    });
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DeployToServerState.java

示例4: createDebugProcess

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@NotNull
@Override
protected PyDebugProcess createDebugProcess(@NotNull XDebugSession session,
                                            ServerSocket serverSocket,
                                            ExecutionResult result,
                                            PythonCommandLineState pyState) {
  ExecutionConsole executionConsole = result.getExecutionConsole();
  ProcessHandler processHandler = result.getProcessHandler();
  boolean isMultiProcess = pyState.isMultiprocessDebug();
  String scriptName = getScriptName(pyState);
  if (scriptName != null) {
    VirtualFile file = VfsUtil.findFileByIoFile(new File(scriptName), true);
    if (file != null) {
      int line = getBreakpointLineNumber(file, session.getProject());
      if (line != NO_LINE) {
        return new PyEduDebugProcess(session, serverSocket,
                                     executionConsole, processHandler,
                                     isMultiProcess, scriptName, line + 1);
      }
    }
  }
  LOG.info("Failed to create PyEduDebugProcess. PyDebugProcess created instead.");
  return new PyDebugProcess(session, serverSocket, executionConsole,
                            processHandler, isMultiProcess);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PyEduDebugRunner.java

示例5: createSession

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
protected XDebugSession createSession(@NotNull RunProfileState state, @NotNull final ExecutionEnvironment environment)
  throws ExecutionException {
  FileDocumentManager.getInstance().saveAllDocuments();

  final PythonCommandLineState pyState = (PythonCommandLineState)state;
  final ServerSocket serverSocket = PythonCommandLineState.createServerSocket();
  final int serverLocalPort = serverSocket.getLocalPort();
  RunProfile profile = environment.getRunProfile();
  final ExecutionResult result =
    pyState.execute(environment.getExecutor(), createCommandLinePatchers(environment.getProject(), pyState, profile, serverLocalPort));

  return XDebuggerManager.getInstance(environment.getProject()).
    startSession(environment, new XDebugProcessStarter() {
      @Override
      @NotNull
      public XDebugProcess start(@NotNull final XDebugSession session) {
        PyDebugProcess pyDebugProcess =
          createDebugProcess(session, serverSocket, result, pyState);

        createConsoleCommunicationAndSetupActions(environment.getProject(), result, pyDebugProcess, session);
        return pyDebugProcess;
      }
    });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PyDebugRunner.java

示例6: execute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Override
public ExecutionResult execute(Executor executor, CommandLinePatcher... patchers) throws ExecutionException {
  final ProcessHandler processHandler = startProcess(patchers);
  final ConsoleView console = createAndAttachConsole(myConfiguration.getProject(), processHandler, executor);

  List<AnAction> actions = Lists
    .newArrayList(createActions(console, processHandler));

  DefaultExecutionResult executionResult =
    new DefaultExecutionResult(console, processHandler, actions.toArray(new AnAction[actions.size()]));

  PyRerunFailedTestsAction rerunFailedTestsAction = new PyRerunFailedTestsAction(console);
  if (console instanceof SMTRunnerConsoleView) {
    rerunFailedTestsAction.init(((BaseTestsOutputConsoleView)console).getProperties());
    rerunFailedTestsAction.setModelProvider(new Getter<TestFrameworkRunningModel>() {
    @Override
    public TestFrameworkRunningModel get() {
      return ((SMTRunnerConsoleView)console).getResultsViewer();
    }
  });
  }

  executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
  return executionResult;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PythonTestCommandLineStateBase.java

示例7: execute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
  RunProfile profile = myEnvironment.getRunProfile();
  if (profile instanceof AntRunConfiguration) {
    AntRunConfiguration antRunConfiguration = (AntRunConfiguration)profile;
    AntBuildTarget target = antRunConfiguration.getTarget();
    if (target == null) return null;
    ProcessHandler processHandler = ExecutionHandler
      .executeRunConfiguration(antRunConfiguration, myEnvironment.getDataContext(), new ArrayList<BuildFileProperty>(),
                               new AntBuildListener() {
                                 @Override
                                 public void buildFinished(int state, int errorCount) {

                                 }
                               });
    if (processHandler == null) return null;
    return new DefaultExecutionResult(null, processHandler);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AntRunProfileState.java

示例8: createContentDescriptor

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
protected RunContentDescriptor createContentDescriptor(final RunProfileState runProfileState, final ExecutionEnvironment environment) throws ExecutionException {
  final XDebugSession debugSession =
    XDebuggerManager.getInstance(environment.getProject()).startSession(environment, new XDebugProcessStarter() {
      @NotNull
      public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
        ACTIVE.set(Boolean.TRUE);
        try {
          final XsltCommandLineState c = (XsltCommandLineState)runProfileState;
          final ExecutionResult result = runProfileState.execute(environment.getExecutor(), XsltDebuggerRunner.this);
          return new XsltDebugProcess(session, result, c.getExtensionData().getUserData(XsltDebuggerExtension.VERSION));
        } finally {
          ACTIVE.remove();
        }
      }
    });
  return debugSession.getRunContentDescriptor();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:XsltDebuggerRunner.java

示例9: execute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Override
public ExecutionResult execute(Executor executor, CommandLinePatcher... patchers) throws ExecutionException {
    final ProcessHandler processHandler = startProcess(getDefaultPythonProcessStarter(), patchers);
    final ConsoleView console = createAndAttachConsole(configuration.getProject(), processHandler, executor);

    DefaultExecutionResult executionResult = new DefaultExecutionResult(console, processHandler, createActions(console, processHandler));

    PTestRerunFailedTestsAction rerunFailedTestsAction = new PTestRerunFailedTestsAction(console);
    if (console instanceof SMTRunnerConsoleView) {
        rerunFailedTestsAction.init(((BaseTestsOutputConsoleView) console).getProperties());
        rerunFailedTestsAction.setModelProvider(() -> ((SMTRunnerConsoleView) console).getResultsViewer());
    }

    executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
    return executionResult;
}
 
开发者ID:KarlGong,项目名称:ptest-pycharm-plugin,代码行数:17,代码来源:PTestCommandLineState.java

示例10: doExecute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException {
    if(DEBUG_EXECUTOR.equals(environment.getExecutor().getId())) {
        RoboVmRunConfiguration runConfig = (RoboVmRunConfiguration)environment.getRunProfile();
        RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", "" + runConfig.getDebugPort(), false);
        connection.setServerMode(true);
        return attachVirtualMachine(state, environment, connection, false);
    } else {
        ExecutionResult executionResult = state.execute(environment.getExecutor(), this);
        if (executionResult == null) {
            return null;
        }
        return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse());
    }
}
 
开发者ID:robovm,项目名称:robovm-idea,代码行数:17,代码来源:RoboVmRunner.java

示例11: execute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, ProgramRunner programRunner) throws ExecutionException {
    try {
        String cmd =  PerlCli.getPerlPath(project);
        String[] params = {cmd ,"-e","'print 1;'"};

        Process p = Runtime.getRuntime().exec(params);
        BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));

        String line;
        String sdkVersion = "UNKNOWN";
        while ((line = input.readLine()) != null) {
            Utils.print(sdkVersion = line);
        }
        input.close();
        int result = p.waitFor();
        if (result != 0) {
            throw new Exception("Failed to get perl version - make sure PERL_HOME directs to the right folder");
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;//TODO:: Implement ExecutionResult
}
 
开发者ID:eli1982,项目名称:intellij-perl-plugin,代码行数:26,代码来源:PerlRunProfileState.java

示例12: doExecute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@Override
@RequiredDispatchThread
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException
{
	UnityProcess editorProcess = UnityEditorCommunication.findEditorProcess();
	if(editorProcess == null)
	{
		throw new ExecutionException("Editor is not responding");
	}
	FileDocumentManager.getInstance().saveAllDocuments();

	ExecutionResult executionResult = state.execute(env.getExecutor(), this);
	if(executionResult == null)
	{
		return null;
	}
	return Unity3dAttachRunner.runContentDescriptor(executionResult, env, editorProcess, (ConsoleView) executionResult.getExecutionConsole(), true);
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:19,代码来源:Unity3dTestDebuggerRunner.java

示例13: execute

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    if (GaugeVersion.isGreaterOrEqual(GaugeRunConfiguration.TEST_RUNNER_SUPPORT_VERSION, false)
            && GaugeSettingsService.getSettings().useIntelliJTestRunner()) {
        ProcessHandler handler = startProcess();
        GaugeConsoleProperties properties = new GaugeConsoleProperties(config, "Gauge", executor, handler);
        ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("Gauge", handler, properties);
        DefaultExecutionResult result = new DefaultExecutionResult(console, handler, createActions(console, handler));
        if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
            AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(console);
            if (action != null) {
                action.setModelProvider(((SMTRunnerConsoleView) console)::getResultsViewer);
                result.setRestartActions(action);
            }
        }
        return result;
    }
    return super.execute(executor, runner);
}
 
开发者ID:getgauge,项目名称:Intellij-Plugin,代码行数:21,代码来源:GaugeCommandLineState.java

示例14: createContentDescriptor

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
protected RunContentDescriptor createContentDescriptor(Project project,
                                                       final RunProfileState runProfileState,
                                                       RunContentDescriptor contentToReuse,
                                                       final ExecutionEnvironment executionEnvironment) throws ExecutionException {
  final XDebugSession debugSession =
    XDebuggerManager.getInstance(project).startSession(this, executionEnvironment, contentToReuse, new XDebugProcessStarter() {
      @NotNull
      public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
        ACTIVE.set(Boolean.TRUE);
        try {
          final XsltCommandLineState c = (XsltCommandLineState)runProfileState;
          final ExecutionResult result = runProfileState.execute(executionEnvironment.getExecutor(), XsltDebuggerRunner.this);
          return new XsltDebugProcess(session, result, c.getExtensionData().getUserData(XsltDebuggerExtension.VERSION));
        } finally {
          ACTIVE.remove();
        }
      }
    });
  return debugSession.getRunContentDescriptor();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:XsltDebuggerRunner.java

示例15: getProcessStarter

import com.intellij.execution.ExecutionResult; //导入依赖的package包/类
private XDebugProcessStarter getProcessStarter(final RunProfileState runProfileState, final ExecutionEnvironment
        executionEnvironment) throws ExecutionException {
    int port = getAvailablePort();
    ((XQueryRunProfileState) runProfileState).setPort(port);
    return new XDebugProcessStarter() {
        @NotNull
        public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
            final ExecutionResult result = runProfileState.execute(executionEnvironment.getExecutor(), XQueryDebuggerRunner.this);
            XQueryDebugProcess.XQueryDebuggerIde debuggerIde = new XQueryDebugProcess.XQueryDebuggerIde(session, result.getProcessHandler());
            final DBGpIde dbgpIde = ide().withPort(port).withDebuggerIde(debuggerIde).build();
            dbgpIde.startListening();
            result.getProcessHandler().addProcessListener(new ProcessAdapter() {
                @Override
                public void processTerminated(ProcessEvent event) {
                    dbgpIde.stopListening();
                }
            });
            return new XQueryDebugProcess(session, result, dbgpIde);
        }
    };
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:22,代码来源:XQueryDebuggerRunner.java


注:本文中的com.intellij.execution.ExecutionResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。