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


Java ProcessHandler.detachProcess方法代码示例

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


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

示例1: stopProcess

import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
public static void stopProcess(@Nullable ProcessHandler processHandler) {
  if (processHandler instanceof KillableProcess && processHandler.isProcessTerminating()) {
    // process termination was requested, but it's still alive
    // in this case 'force quit' will be performed
    ((KillableProcess)processHandler).killProcess();
    return;
  }

  if (processHandler != null) {
    if (processHandler.detachIsDefault()) {
      processHandler.detachProcess();
    }
    else {
      processHandler.destroyProcess();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:StopProcessAction.java

示例2: stop

import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
private static void stop(@Nullable RunContentDescriptor descriptor) {
  ProcessHandler processHandler = descriptor != null ? descriptor.getProcessHandler() : null;
  if (processHandler == null) {
    return;
  }

  if (processHandler instanceof KillableProcess && processHandler.isProcessTerminating()) {
    ((KillableProcess)processHandler).killProcess();
    return;
  }

  if (!processHandler.isProcessTerminated()) {
    if (processHandler.detachIsDefault()) {
      processHandler.detachProcess();
    }
    else {
      processHandler.destroyProcess();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ExecutionManagerImpl.java

示例3: tryToCloseOldSessions

import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
private static void tryToCloseOldSessions(final Executor executor, Project project) {
  final ExecutionManager manager = ExecutionManager.getInstance(project);
  ProcessHandler[] processes = manager.getRunningProcesses();
  for (ProcessHandler process : processes) {
    final AndroidSessionInfo info = process.getUserData(ANDROID_SESSION_INFO);
    if (info != null) {
      process.addProcessListener(new ProcessAdapter() {
        @Override
        public void processTerminated(ProcessEvent event) {
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
            public void run() {
              manager.getContentManager().removeRunContent(executor, info.getDescriptor());
            }
          });
        }
      });
      process.detachProcess();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AndroidDebugRunner.java

示例4: stop

import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
@Override
public void stop() {
  ProcessHandler processHandler = myDebugProcess.getProcessHandler();
  if (processHandler.isProcessTerminated() || processHandler.isProcessTerminating()) return;

  if (processHandler.detachIsDefault()) {
    processHandler.detachProcess();
  }
  else {
    processHandler.destroyProcess();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:XDebugSessionImpl.java

示例5: stopProcess

import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
private static void stopProcess(@Nullable RunContentDescriptor descriptor) {
  ProcessHandler processHandler = descriptor != null ? descriptor.getProcessHandler() : null;
  if (processHandler == null) return;
  if (processHandler instanceof KillableProcess && processHandler.isProcessTerminating()) {
    ((KillableProcess)processHandler).killProcess();
    return;
  }

  if (processHandler.detachIsDefault()) {
    processHandler.detachProcess();
  }
  else {
    processHandler.destroyProcess();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:StopAction.java

示例6: closeQuery

import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
private boolean closeQuery(boolean modal) {
  final RunContentDescriptor descriptor = getRunContentDescriptorByContent(myContent);
  if (descriptor == null) {
    return true;
  }

  final ProcessHandler processHandler = descriptor.getProcessHandler();
  if (processHandler == null || processHandler.isProcessTerminated() || processHandler.isProcessTerminating()) {
    return true;
  }
  final boolean destroyProcess;
  //noinspection deprecation
  if (processHandler.isSilentlyDestroyOnClose() || Boolean.TRUE.equals(processHandler.getUserData(ProcessHandler.SILENTLY_DESTROY_ON_CLOSE))) {
    destroyProcess = true;
  }
  else {
    //todo[nik] this is a temporary solution for the following problem: some configurations should not allow user to choose between 'terminating' and 'detaching'
    final boolean useDefault = Boolean.TRUE.equals(processHandler.getUserData(ALWAYS_USE_DEFAULT_STOPPING_BEHAVIOUR_KEY));
    final TerminateRemoteProcessDialog.TerminateOption option = new TerminateRemoteProcessDialog.TerminateOption(processHandler.detachIsDefault(), useDefault);
    final int rc = TerminateRemoteProcessDialog.show(myProject, descriptor.getDisplayName(), option);
    if (rc != DialogWrapper.OK_EXIT_CODE) return false;
    destroyProcess = !option.isToBeShown();
  }
  if (destroyProcess) {
    processHandler.destroyProcess();
  }
  else {
    processHandler.detachProcess();
  }
  waitForProcess(descriptor, modal);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:RunContentManagerImpl.java


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