use of com.intellij.openapi.wm.ToolWindowType in project intellij-community by JetBrains.
the class ToggleDockModeAction method setSelected.
public void setSelected(AnActionEvent event, boolean flag) {
Project project = event.getProject();
if (project == null) {
return;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
String id = windowManager.getActiveToolWindowId();
if (id == null) {
return;
}
ToolWindow toolWindow = windowManager.getToolWindow(id);
ToolWindowType type = toolWindow.getType();
if (ToolWindowType.DOCKED == type) {
toolWindow.setType(ToolWindowType.SLIDING, null);
} else if (ToolWindowType.SLIDING == type) {
toolWindow.setType(ToolWindowType.DOCKED, null);
}
}
use of com.intellij.openapi.wm.ToolWindowType in project intellij-community by JetBrains.
the class ToggleFloatingModeAction method setSelected.
public void setSelected(AnActionEvent event, boolean flag) {
Project project = event.getProject();
if (project == null) {
return;
}
String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
if (id == null) {
return;
}
ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
ToolWindowEx toolWindow = (ToolWindowEx) mgr.getToolWindow(id);
ToolWindowType type = toolWindow.getType();
if (ToolWindowType.FLOATING == type) {
toolWindow.setType(toolWindow.getInternalType(), null);
} else {
toolWindow.setType(ToolWindowType.FLOATING, null);
}
}
use of com.intellij.openapi.wm.ToolWindowType in project intellij-community by JetBrains.
the class ToggleWindowedModeAction method setSelected.
public void setSelected(AnActionEvent event, boolean flag) {
Project project = event.getProject();
if (project == null) {
return;
}
String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
if (id == null) {
return;
}
ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
ToolWindowEx toolWindow = (ToolWindowEx) mgr.getToolWindow(id);
ToolWindowType type = toolWindow.getType();
if (ToolWindowType.WINDOWED == type) {
toolWindow.setType(toolWindow.getInternalType(), null);
} else {
toolWindow.setType(ToolWindowType.WINDOWED, null);
}
}
use of com.intellij.openapi.wm.ToolWindowType in project intellij-community by JetBrains.
the class ToolWindowHeader method paintComponent.
@Override
protected void paintComponent(Graphics g) {
Rectangle r = getBounds();
Graphics2D g2d = (Graphics2D) g;
Shape clip = g2d.getClip();
ToolWindowType type = myToolWindow.getType();
Image image;
if (isActive()) {
if (myActiveImage == null || /*myActiveImage.getHeight() != r.height ||*/
type != myImageType) {
myActiveImage = drawToBuffer(true, r.height, myToolWindow.getType() == ToolWindowType.FLOATING);
}
image = myActiveImage;
} else {
if (myImage == null || /*myImage.getHeight() != r.height ||*/
type != myImageType) {
myImage = drawToBuffer(false, r.height, myToolWindow.getType() == ToolWindowType.FLOATING);
}
image = myImage;
}
myImageType = myToolWindow.getType();
Rectangle clipBounds = clip.getBounds();
for (int x = clipBounds.x; x < clipBounds.x + clipBounds.width; x += 150) {
UIUtil.drawImage(g, image, x, 0, null);
}
}
use of com.intellij.openapi.wm.ToolWindowType in project android by JetBrains.
the class NlAbstractWindowManager method initToolWindow.
protected void initToolWindow(@NotNull final String id, @NotNull Icon icon) {
myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(id, false, getAnchor(), myProject, true);
myToolWindow.setIcon(icon);
myToolWindow.setAvailable(false, null);
myToolWindow.setAutoHide(false);
myPreviousWindowType = myToolWindow.getType();
myPreviousWindowAnchor = getEditorMode();
((ToolWindowManagerEx) ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerAdapter() {
@Override
public void stateChanged() {
if (myProject.isDisposed()) {
return;
}
final ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(id);
ToolWindowType newWindowType = window.getType();
ToolWindowAnchor newWindowAnchor = getEditorMode();
if (newWindowType != myPreviousWindowType || newWindowAnchor != myPreviousWindowAnchor) {
// TODO: Report the window docking state
NlUsageTrackerManager.getInstance(myDesignSurface).logAction(LayoutEditorEvent.LayoutEditorEventType.UNKNOWN_EVENT_TYPE);
myPreviousWindowType = newWindowType;
myPreviousWindowAnchor = newWindowAnchor;
}
}
}, myProject);
initGearActions();
}
Aggregations