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


Java OSProcessHandler.setShouldDestroyProcessRecursively方法代码示例

本文整理汇总了Java中com.intellij.execution.process.OSProcessHandler.setShouldDestroyProcessRecursively方法的典型用法代码示例。如果您正苦于以下问题:Java OSProcessHandler.setShouldDestroyProcessRecursively方法的具体用法?Java OSProcessHandler.setShouldDestroyProcessRecursively怎么用?Java OSProcessHandler.setShouldDestroyProcessRecursively使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.process.OSProcessHandler的用法示例。


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

示例1: startProcess

import com.intellij.execution.process.OSProcessHandler; //导入方法依赖的package包/类
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
  OSProcessHandler handler = super.startProcess();
  handler.setShouldDestroyProcessRecursively(true);
  final RunnerSettings runnerSettings = getRunnerSettings();
  JavaRunConfigurationExtensionManager.getInstance().attachExtensionsToProcess(MvcRunConfiguration.this, handler, runnerSettings);
  return handler;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:MvcRunConfiguration.java

示例2: getState

import com.intellij.execution.process.OSProcessHandler; //导入方法依赖的package包/类
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) throws ExecutionException {
  final VirtualFile script = getScriptFile();
  if (script == null) {
    throw new CantRunException("Cannot find script " + scriptPath);
  }

  final GroovyScriptRunner scriptRunner = findConfiguration();
  if (scriptRunner == null) {
    throw new CantRunException("Unknown script type " + scriptPath);
  }

  final Module module = ObjectUtils.chooseNotNull(getModule(), ContainerUtil.getFirstItem(getValidModules()));
  if (!scriptRunner.ensureRunnerConfigured(module, this, executor, getProject())) {
    return null;
  }

  final boolean tests = ProjectRootManager.getInstance(getProject()).getFileIndex().isInTestSourceContent(script);

  return new JavaCommandLineState(environment) {
    @NotNull
    @Override
    protected OSProcessHandler startProcess() throws ExecutionException {
      final OSProcessHandler handler = super.startProcess();
      handler.setShouldDestroyProcessRecursively(true);
      if (scriptRunner.shouldRefreshAfterFinish()) {
        handler.addProcessListener(new ProcessAdapter() {
          @Override
          public void processTerminated(ProcessEvent event) {
            if (!ApplicationManager.getApplication().isDisposed()) {
              VirtualFileManager.getInstance().asyncRefresh(null);
            }
          }
        });
      }

      return handler;
    }

    @Override
    protected JavaParameters createJavaParameters() throws ExecutionException {
      JavaParameters params = createJavaParametersWithSdk(module);
      ProgramParametersUtil.configureConfiguration(params, GroovyScriptRunConfiguration.this);
      scriptRunner.configureCommandLine(params, module, tests, script, GroovyScriptRunConfiguration.this);

      return params;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:50,代码来源:GroovyScriptRunConfiguration.java

示例3: getState

import com.intellij.execution.process.OSProcessHandler; //导入方法依赖的package包/类
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) throws ExecutionException {
  final VirtualFile script = getScriptFile();
  if (script == null) {
    throw new CantRunException("Cannot find script " + scriptPath);
  }

  final GroovyScriptRunner scriptRunner = findConfiguration();
  if (scriptRunner == null) {
    throw new CantRunException("Unknown script type " + scriptPath);
  }

  final Module module = getModule();
  if (!scriptRunner.ensureRunnerConfigured(module, this, executor, getProject())) {
    return null;
  }

  final boolean tests = ProjectRootManager.getInstance(getProject()).getFileIndex().isInTestSourceContent(script);

  return new JavaCommandLineState(environment) {
    @NotNull
    @Override
    protected OSProcessHandler startProcess() throws ExecutionException {
      final OSProcessHandler handler = super.startProcess();
      handler.setShouldDestroyProcessRecursively(true);
      if (scriptRunner.shouldRefreshAfterFinish()) {
        handler.addProcessListener(new ProcessAdapter() {
          @Override
          public void processTerminated(ProcessEvent event) {
            if (!ApplicationManager.getApplication().isDisposed()) {
              VirtualFileManager.getInstance().asyncRefresh(null);
            }
          }
        });
      }

      return handler;
    }

    protected JavaParameters createJavaParameters() throws ExecutionException {
      JavaParameters params = createJavaParametersWithSdk(module);
      ProgramParametersUtil.configureConfiguration(params, GroovyScriptRunConfiguration.this);
      scriptRunner.configureCommandLine(params, module, tests, script, GroovyScriptRunConfiguration.this);

      return params;
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:48,代码来源:GroovyScriptRunConfiguration.java


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