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


Java RunContentDescriptor.getAttachedContent方法代码示例

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


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

示例1: setAutoTestEnabled

import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
public void setAutoTestEnabled(@NotNull RunContentDescriptor descriptor, @NotNull ExecutionEnvironment environment, boolean enabled) {
  Content content = descriptor.getAttachedContent();
  if (content != null) {
    if (enabled) {
      EXECUTION_ENVIRONMENT_KEY.set(content, environment);
      myDocumentWatcher.activate();
    }
    else {
      EXECUTION_ENVIRONMENT_KEY.set(content, null);
      if (!hasEnabledAutoTests()) {
        myDocumentWatcher.deactivate();
      }
      ProcessHandler processHandler = descriptor.getProcessHandler();
      if (processHandler != null) {
        clearRestarterListener(processHandler);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AutoTestManager.java

示例2: isAutoTestEnabledForDescriptor

import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
private static boolean isAutoTestEnabledForDescriptor(@NotNull RunContentDescriptor descriptor) {
  Content content = descriptor.getAttachedContent();
  if (content != null) {
    ExecutionEnvironment watched = EXECUTION_ENVIRONMENT_KEY.get(content);
    if (watched != null) {
      ExecutionEnvironment current = getCurrentEnvironment(content);
      boolean result = current != null && equals(current, watched);
      if (!result) {
        // let GC do its work
        EXECUTION_ENVIRONMENT_KEY.set(content, null);
      }
      return result;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AutoTestManager.java

示例3: closeOldSessionAndRun

import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
private void closeOldSessionAndRun(final String debugPort) {
  final String configurationName = getRunConfigurationName(debugPort);
  final Collection<RunContentDescriptor> descriptors =
    ExecutionHelper.findRunningConsoleByTitle(myProject, new NotNullFunction<String, Boolean>() {
      @NotNull
      @Override
      public Boolean fun(String title) {
        return configurationName.equals(title);
      }
    });

  if (descriptors.size() > 0) {
    final RunContentDescriptor descriptor = descriptors.iterator().next();
    final ProcessHandler processHandler = descriptor.getProcessHandler();
    final Content content = descriptor.getAttachedContent();

    if (processHandler != null && content != null) {
      final Executor executor = DefaultDebugExecutor.getDebugExecutorInstance();

      if (processHandler.isProcessTerminated()) {
        ExecutionManager.getInstance(myProject).getContentManager()
          .removeRunContent(executor, descriptor);
      }
      else {
        content.getManager().setSelectedContent(content);
        ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(executor.getToolWindowId());
        window.activate(null, false, true);
        return;
      }
    }
  }

  runSession(debugPort);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:AndroidProcessChooserDialog.java


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