use of com.intellij.execution.ui.RunContentManager in project intellij-community by JetBrains.
the class ExecutionHelper method descriptorToFront.
private static void descriptorToFront(@NotNull final Project project, @NotNull final RunContentDescriptor descriptor) {
ApplicationManager.getApplication().invokeLater(() -> {
RunContentManager manager = ExecutionManager.getInstance(project).getContentManager();
ToolWindow toolWindow = manager.getToolWindowByDescriptor(descriptor);
if (toolWindow != null) {
toolWindow.show(null);
manager.selectRunContent(descriptor);
}
}, project.getDisposed());
}
use of com.intellij.execution.ui.RunContentManager in project intellij-community by JetBrains.
the class ExecutionHelper method findRunningConsole.
public static Collection<RunContentDescriptor> findRunningConsole(@NotNull Project project, @NotNull NotNullFunction<RunContentDescriptor, Boolean> descriptorMatcher) {
RunContentManager contentManager = ExecutionManager.getInstance(project).getContentManager();
final RunContentDescriptor selectedContent = contentManager.getSelectedContent();
if (selectedContent != null) {
final ToolWindow toolWindow = contentManager.getToolWindowByDescriptor(selectedContent);
if (toolWindow != null && toolWindow.isVisible()) {
if (descriptorMatcher.fun(selectedContent)) {
return Collections.singletonList(selectedContent);
}
}
}
final ArrayList<RunContentDescriptor> result = ContainerUtil.newArrayList();
for (RunContentDescriptor runContentDescriptor : contentManager.getAllDescriptors()) {
if (descriptorMatcher.fun(runContentDescriptor)) {
result.add(runContentDescriptor);
}
}
return result;
}
use of com.intellij.execution.ui.RunContentManager in project intellij-community by JetBrains.
the class XDebugSessionTab method toFront.
public void toFront(boolean focus, @Nullable final Runnable onShowCallback) {
if (ApplicationManager.getApplication().isUnitTestMode())
return;
ApplicationManager.getApplication().invokeLater(() -> {
if (myRunContentDescriptor != null) {
RunContentManager manager = ExecutionManager.getInstance(myProject).getContentManager();
ToolWindow toolWindow = manager.getToolWindowByDescriptor(myRunContentDescriptor);
if (toolWindow != null) {
if (!toolWindow.isVisible()) {
toolWindow.show(() -> {
if (onShowCallback != null) {
onShowCallback.run();
}
myRebuildWatchesRunnable.run();
});
}
manager.selectRunContent(myRunContentDescriptor);
}
}
});
if (focus) {
ApplicationManager.getApplication().invokeLater(() -> {
boolean focusWnd = Registry.is("debugger.mayBringFrameToFrontOnBreakpoint");
ProjectUtil.focusProjectWindow(myProject, focusWnd);
if (!focusWnd) {
AppIcon.getInstance().requestAttention(myProject, true);
}
});
}
}
use of com.intellij.execution.ui.RunContentManager in project intellij-community by JetBrains.
the class DebuggerSessionTabBase method select.
public void select() {
if (ApplicationManager.getApplication().isUnitTestMode())
return;
UIUtil.invokeLaterIfNeeded(() -> {
if (myRunContentDescriptor != null) {
RunContentManager manager = ExecutionManager.getInstance(myProject).getContentManager();
ToolWindow toolWindow = manager.getToolWindowByDescriptor(myRunContentDescriptor);
Content content = myRunContentDescriptor.getAttachedContent();
if (toolWindow == null || content == null)
return;
manager.selectRunContent(myRunContentDescriptor);
}
});
}
use of com.intellij.execution.ui.RunContentManager in project intellij-community by JetBrains.
the class AbstractAutoTestManager method restartAllAutoTests.
protected void restartAllAutoTests(int modificationStamp) {
RunContentManager contentManager = ExecutionManager.getInstance(myProject).getContentManager();
boolean active = false;
for (RunContentDescriptor descriptor : contentManager.getAllDescriptors()) {
if (isAutoTestEnabledForDescriptor(descriptor)) {
restartAutoTest(descriptor, modificationStamp, myWatcher);
active = true;
}
}
if (!active) {
myWatcher.deactivate();
}
}
Aggregations