use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class PinActiveTabAction method getToolWindowContent.
@Nullable
private static Content getToolWindowContent(@NotNull AnActionEvent e) {
// note to future readers: TW tab "pinned" icon is shown when content.getUserData(TW.SHOW_CONTENT_ICON) is true
ToolWindow window = PlatformDataKeys.TOOL_WINDOW.getData(e.getDataContext());
Content result = window != null ? window.getContentManager().getSelectedContent() : null;
return result != null && result.isPinnable() ? result : null;
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ShowContentAction method update.
@Override
public void update(AnActionEvent e) {
final ToolWindow window = getWindow(e);
e.getPresentation().setEnabledAndVisible(window != null && window.getContentManager().getContentCount() > 1);
e.getPresentation().setText(window == null || window.getContentUiType() == ToolWindowContentUiType.TABBED ? "Show List of Tabs" : "Show List of Views");
}
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();
}
Aggregations