本文整理汇总了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;
}
示例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;
}
};
}
示例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;
}
};
}