use of com.intellij.designer.LightToolWindow in project android by JetBrains.
the class AnalysisResultsManager method createContent.
@Override
protected LightToolWindow createContent(@NotNull DesignerEditorPanelFacade designer) {
AnalysisResultsContent content = new AnalysisResultsContent();
content.update(designer);
Icon icon = content.getIcon();
if (icon == null) {
icon = getIcon();
}
// TODO figure out how to properly dispose this if it needs to be
JComponent focus = content.getFocusComponent();
LightToolWindow lightToolWindow = createContent(designer, content, getToolWindowTitleBarText(), icon, content.getMainPanel(), focus == null ? content.getMainPanel() : focus, 320, createActions());
try {
// When LightToolWindow#minimize() is added to the base platform and upstreamed,
// replace this:
LightToolWindow.class.getDeclaredMethod("minimize").invoke(lightToolWindow);
// with lightToolWindow.minimize();
} catch (Exception ignore) {
}
return lightToolWindow;
}
use of com.intellij.designer.LightToolWindow in project android by JetBrains.
the class AnalysisResultsManager method getContentFromDesigner.
@Nullable
private AnalysisResultsContent getContentFromDesigner() {
DesignerEditorPanelFacade activeDesigner = getActiveDesigner();
if (activeDesigner != null && activeDesigner instanceof CapturePanel) {
Object property = activeDesigner.getClientProperty(getComponentName());
if (property instanceof LightToolWindow) {
LightToolWindow lightToolWindow = (LightToolWindow) property;
Object content = lightToolWindow.getContent();
if (content instanceof AnalysisResultsContent) {
return (AnalysisResultsContent) content;
}
} else if (property instanceof AnalysisResultsContent) {
return (AnalysisResultsContent) property;
}
}
return null;
}
use of com.intellij.designer.LightToolWindow in project android by JetBrains.
the class NlAbstractWindowManager method activateToolWindow.
public void activateToolWindow(@NotNull DesignerEditorPanelFacade designer, @NotNull Runnable runnable) {
LightToolWindow toolWindow = (LightToolWindow) designer.getClientProperty(getComponentName());
if (toolWindow != null) {
restore(toolWindow);
runnable.run();
} else {
myToolWindow.show(runnable);
}
}
use of com.intellij.designer.LightToolWindow in project android by JetBrains.
the class LayersManager method createContent.
@Override
protected LightToolWindow createContent(@NotNull DesignerEditorPanelFacade designer) {
if (!(designer instanceof LayeredImageEditorPanel)) {
return null;
}
LightToolWindow toolWindow = (LightToolWindow) designer.getClientProperty(getComponentName());
if (toolWindow != null) {
return toolWindow;
}
LayersPanel layersPanel = new LayersPanel();
layersPanel.setImage(getImage(designer));
PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(myProject);
// When LightToolWindowManager#getEditorMode() is public (or a constructor which lets
// me not specify it) is available and upstreamed, replace the following with just
// anchor = getEditorMode() :
String value = propertiesComponent.getValue(myEditorModeKey);
ToolWindowAnchor anchor;
if (value == null) {
anchor = getAnchor();
} else {
anchor = value.equals("ToolWindow") ? null : ToolWindowAnchor.fromText(value);
}
ThreeComponentsSplitter contentSplitter = designer.getContentSplitter();
if (contentSplitter.getInnerComponent() == null) {
// This is a fix for http://b.android.com/219047
return null;
}
return new LightToolWindow(layersPanel, "Image Layers", AllIcons.Toolwindows.ToolWindowPalette, layersPanel, layersPanel, contentSplitter, anchor, this, myProject, propertiesComponent, getVisibilityKeyName(designer), 200, null);
}
Aggregations