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