use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ToggleDockModeAction method update.
public void update(AnActionEvent event) {
super.update(event);
Presentation presentation = event.getPresentation();
Project project = event.getProject();
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManager mgr = ToolWindowManager.getInstance(project);
String id = mgr.getActiveToolWindowId();
if (id == null) {
presentation.setEnabled(false);
return;
}
ToolWindow toolWindow = mgr.getToolWindow(id);
presentation.setEnabled(toolWindow.isAvailable() && toolWindow.getType() != ToolWindowType.FLOATING && toolWindow.getType() != ToolWindowType.WINDOWED);
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class SwitcherToolWindowsListRenderer method customizeCellRenderer.
protected void customizeCellRenderer(@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) {
hide = false;
setPaintFocusBorder(false);
if (value instanceof ToolWindow) {
final ToolWindow tw = (ToolWindow) value;
setIcon(getIcon(tw));
final String name;
String stripeTitle = tw.getStripeTitle();
String shortcut = shortcuts.get(tw);
if (myPinned || shortcut == null) {
name = stripeTitle;
} else {
append(shortcut, new SimpleTextAttributes(SimpleTextAttributes.STYLE_UNDERLINE, null));
name = ": " + stripeTitle;
}
append(name);
if (mySpeedSearch != null && mySpeedSearch.isPopupActive()) {
hide = mySpeedSearch.matchingFragments(stripeTitle) == null && !StringUtil.isEmpty(mySpeedSearch.getEnteredPrefix());
}
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ToolWindowsPane method setMaximized.
void setMaximized(@NotNull ToolWindow wnd, boolean maximized) {
Pair<Resizer, Component> resizerAndComponent = findResizerAndComponent(wnd);
if (resizerAndComponent == null)
return;
if (!maximized) {
ToolWindow maximizedWindow = myMaximizedProportion.first;
assert maximizedWindow == wnd;
resizerAndComponent.first.setSize(myMaximizedProportion.second);
myMaximizedProportion = null;
} else {
int size = wnd.getAnchor().isHorizontal() ? resizerAndComponent.second.getHeight() : resizerAndComponent.second.getWidth();
stretch(wnd, Short.MAX_VALUE);
myMaximizedProportion = Pair.create(wnd, size);
}
doLayout();
}
use of com.intellij.openapi.wm.ToolWindow 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.openapi.wm.ToolWindow 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);
}
});
}
Aggregations