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


Java DefaultExecutionResult类代码示例

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


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

示例1: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的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

示例2: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的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

示例3: attachRerunFailedTestsAction

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
public static DefaultExecutionResult attachRerunFailedTestsAction(DefaultExecutionResult result) {
  ExecutionConsole console = result.getExecutionConsole();
  if (!(console instanceof SMTRunnerConsoleView)) {
    return result;
  }
  SMTRunnerConsoleView smConsole = (SMTRunnerConsoleView) console;
  TestConsoleProperties consoleProperties = smConsole.getProperties();
  if (!(consoleProperties instanceof BlazeTestConsoleProperties)) {
    return result;
  }
  BlazeTestConsoleProperties properties = (BlazeTestConsoleProperties) consoleProperties;
  AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(smConsole);
  if (action != null) {
    action.init(properties);
    action.setModelProvider(smConsole::getResultsViewer);
    result.setRestartActions(action);
  }
  return result;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:20,代码来源:SmRunnerUtils.java

示例4: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的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

示例5: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的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

示例6: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@Nullable
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
  final TestConsoleProperties testConsoleProperties =
      new SMTRunnerConsoleProperties(jsTestDriverConfiguration, "jsTestDriver", executor);
  final CountDownLatch receivingSocketOpen = new CountDownLatch(1);
  Future<ProcessData> data = attachExecutor.submit(new Callable<ProcessData>() {
    public ProcessData call() throws Exception {
      // Let the receiver start before we write anything to it.
      receivingSocketOpen.await();
      ProcessHandler processHandler = startProcess();
      BaseTestsOutputConsoleView consoleView =
          attachRunner(project.getName(), processHandler, testConsoleProperties, getRunnerSettings(), getConfigurationSettings());
      return new ProcessData((SMTRunnerConsoleView) consoleView, processHandler);
    }
  });
  TestListenerContext context = new TestListenerContext(data);
  final RemoteTestListener listener = new RemoteTestListener(context);
  testResultReceiverExecutor.submit(
      new RemoteTestResultReceiver(listener, testResultPort, receivingSocketOpen));
  return new DefaultExecutionResult(context.consoleView(), context.processHandler(),
      createActions(context.consoleView(), context.processHandler()));
}
 
开发者ID:BladeRunnerJS,项目名称:brjs-JsTestDriver,代码行数:23,代码来源:TestRunnerState.java

示例7: attachVirtualMachine

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@Nullable
protected RunContentDescriptor attachVirtualMachine(RunProfileState state,
                                                    @NotNull ExecutionEnvironment env,
                                                    RemoteConnection connection,
                                                    boolean pollConnection) throws ExecutionException {
  DebugEnvironment environment = new DefaultDebugEnvironment(env, state, connection, pollConnection);
  final DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(env.getProject()).attachVirtualMachine(environment);
  if (debuggerSession == null) {
    return null;
  }

  final DebugProcessImpl debugProcess = debuggerSession.getProcess();
  if (debugProcess.isDetached() || debugProcess.isDetaching()) {
    debuggerSession.dispose();
    return null;
  }
  if (environment.isRemote()) {
    // optimization: that way BatchEvaluator will not try to lookup the class file in remote VM
    // which is an expensive operation when executed first time
    debugProcess.putUserData(BatchEvaluator.REMOTE_SESSION_KEY, Boolean.TRUE);
  }

  return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() {
    @Override
    @NotNull
    public XDebugProcess start(@NotNull XDebugSession session) {
      XDebugSessionImpl sessionImpl = (XDebugSessionImpl)session;
      ExecutionResult executionResult = debugProcess.getExecutionResult();
      sessionImpl.addExtraActions(executionResult.getActions());
      if (executionResult instanceof DefaultExecutionResult) {
        sessionImpl.addRestartActions(((DefaultExecutionResult)executionResult).getRestartActions());
        sessionImpl.addExtraStopActions(((DefaultExecutionResult)executionResult).getAdditionalStopActions());
      }
      return JavaDebugProcess.create(session, debuggerSession);
    }
  }).getRunContentDescriptor();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:GenericDebuggerRunner.java

示例8: createExecutionResult

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult createExecutionResult() throws ExecutionException {
  ConsoleViewImpl consoleView = new ConsoleViewImpl(myProject, false);
  RemoteDebugProcessHandler process = new RemoteDebugProcessHandler(myProject);
  consoleView.attachToProcess(process);
  return new DefaultExecutionResult(consoleView, process);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaDebuggerLauncherImpl.java

示例9: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
  final MyEmptyProcessHandler handler = new MyEmptyProcessHandler();
  final SMTRunnerConsoleProperties properties = myRunProfile.getProperties();
  RunProfile configuration;
  final String frameworkName;
  if (properties != null) {
    configuration = properties.getConfiguration();
    frameworkName = properties.getTestFrameworkName();
  }
  else {
    configuration = myRunProfile;
    frameworkName = "Import Test Results";
  }
  final ImportedTestConsoleProperties consoleProperties = new ImportedTestConsoleProperties(properties, myFile, handler, myRunProfile.getProject(),
                                                                                            configuration, frameworkName, executor);
  final BaseTestsOutputConsoleView console = SMTestRunnerConnectionUtil.createConsole(consoleProperties.getTestFrameworkName(), 
                                                                                      consoleProperties);
  final JComponent component = console.getComponent();
  AbstractRerunFailedTestsAction rerunFailedTestsAction = null;
  if (component instanceof TestFrameworkRunningModel) {
    rerunFailedTestsAction = consoleProperties.createRerunFailedTestsAction(console);
    if (rerunFailedTestsAction != null) {
      rerunFailedTestsAction.setModelProvider(new Getter<TestFrameworkRunningModel>() {
        @Override
        public TestFrameworkRunningModel get() {
          return (TestFrameworkRunningModel)component;
        }
      });
    }
  }
  
  console.attachToProcess(handler);
  final DefaultExecutionResult result = new DefaultExecutionResult(console, handler);
  if (rerunFailedTestsAction != null) {
    result.setRestartActions(rerunFailedTestsAction);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ImportedTestRunnableState.java

示例10: RunContentDescriptor

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
public RunContentDescriptor(@NotNull RunProfile profile, @NotNull ExecutionResult executionResult, @NotNull RunnerLayoutUi ui) {
  this(executionResult.getExecutionConsole(),
       executionResult.getProcessHandler(),
       ui.getComponent(),
       profile.getName(),
       profile.getIcon(),
       null,
       executionResult instanceof DefaultExecutionResult ? ((DefaultExecutionResult)executionResult).getRestartActions() : null);
  myRunnerLayoutUi = ui;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:RunContentDescriptor.java

示例11: createActionToolbar

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@NotNull
private ActionGroup createActionToolbar(@NotNull final RunContentDescriptor contentDescriptor) {
  final DefaultActionGroup actionGroup = new DefaultActionGroup();
  actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN));
  final AnAction[] actions = contentDescriptor.getRestartActions();
  actionGroup.addAll(actions);
  if (actions.length > 0) {
    actionGroup.addSeparator();
  }


  actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_STOP_PROGRAM));
  if (myExecutionResult instanceof DefaultExecutionResult) {
    actionGroup.addAll(((DefaultExecutionResult)myExecutionResult).getAdditionalStopActions());
  }

  actionGroup.addAll(myExecutionResult.getActions());

  for (AnAction anAction : myRunnerActions) {
    if (anAction != null) {
      actionGroup.add(anAction);
    }
    else {
      actionGroup.addSeparator();
    }
  }

  actionGroup.addSeparator();
  actionGroup.add(myUi.getOptions().getLayoutActions());
  actionGroup.addSeparator();
  actionGroup.add(PinToolwindowTabAction.getPinAction());
  actionGroup.add(new CloseAction(myEnvironment.getExecutor(), contentDescriptor, myProject));
  final String helpId = contentDescriptor.getHelpId();
  actionGroup.add(new ContextHelpAction(helpId != null ? helpId : myEnvironment.getExecutor().getHelpId()));
  return actionGroup;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:RunContentBuilder.java

示例12: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@NotNull
@Override
public ExecutionResult execute(Executor executor, final CommandLinePatcher... patchers) throws ExecutionException {
  if (myConfig.showCommandLineAfterwards()) {
    if (executor.getId() == DefaultDebugExecutor.EXECUTOR_ID) {
      return super.execute(executor, ArrayUtil.append(patchers, new CommandLinePatcher() {
        @Override
        public void patchCommandLine(GeneralCommandLine commandLine) {
          commandLine.getParametersList().getParamsGroup(PythonCommandLineState.GROUP_DEBUGGER).addParameterAt(1, "--cmd-line");
        }
      }));
    }

    PydevConsoleRunner runner =
      new PythonScriptWithConsoleRunner(myConfig.getProject(), myConfig.getSdk(), PyConsoleType.PYTHON, myConfig.getWorkingDirectory(),
                                        myConfig.getEnvs(), patchers);

    runner.runSync();

    List<AnAction> actions = Lists.newArrayList(createActions(runner.getConsoleView(), runner.getProcessHandler()));

    return new DefaultExecutionResult(runner.getConsoleView(), runner.getProcessHandler(), actions.toArray(new AnAction[actions.size()]));
  }
  else {
    return super.execute(executor, patchers);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:PythonScriptCommandLineState.java

示例13: execute

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

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

  return new DefaultExecutionResult(console, processHandler, actions.toArray(new AnAction[actions.size()]));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PythonCommandLineState.java

示例14: execute

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, ProgramRunner runner)
    throws ExecutionException {
  DefaultExecutionResult result = executeInner(executor, runner);
  if (result == null) {
    return null;
  }
  return SmRunnerUtils.attachRerunFailedTestsAction(result);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:11,代码来源:BlazeAndroidRunConfigurationRunner.java

示例15: attachVirtualMachine

import com.intellij.execution.DefaultExecutionResult; //导入依赖的package包/类
@Nullable
protected RunContentDescriptor attachVirtualMachine(RunProfileState state,
                                                    @NotNull ExecutionEnvironment env,
                                                    RemoteConnection connection,
                                                    boolean pollConnection) throws ExecutionException {
    DebugEnvironment environment = new DefaultDebugUIEnvironment(env, state, connection, pollConnection).getEnvironment();
    final DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(env.getProject()).attachVirtualMachine(environment);
    if (debuggerSession == null) {
        return null;
    }

    final DebugProcessImpl debugProcess = debuggerSession.getProcess();
    if (debugProcess.isDetached() || debugProcess.isDetaching()) {
        debuggerSession.dispose();
        return null;
    }
    // optimization: that way BatchEvaluator will not try to lookup the class file in remote VM
    // which is an expensive operation when executed first time
    debugProcess.putUserData(BatchEvaluator.REMOTE_SESSION_KEY, Boolean.TRUE);

    return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() {
        @Override
        @NotNull
        public XDebugProcess start(@NotNull XDebugSession session) {
            XDebugSessionImpl sessionImpl = (XDebugSessionImpl)session;
            ExecutionResult executionResult = debugProcess.getExecutionResult();
            sessionImpl.addExtraActions(executionResult.getActions());
            if (executionResult instanceof DefaultExecutionResult) {
                sessionImpl.addRestartActions(((DefaultExecutionResult)executionResult).getRestartActions());
                sessionImpl.addExtraStopActions(((DefaultExecutionResult)executionResult).getAdditionalStopActions());
            }
            return JavaDebugProcess.create(session, debuggerSession);
        }
    }).getRunContentDescriptor();
}
 
开发者ID:robovm,项目名称:robovm-idea,代码行数:36,代码来源:RoboVmRunner.java


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