Example usage for com.intellij.openapi.wm ToolWindowAnchor fromText

List of usage examples for com.intellij.openapi.wm ToolWindowAnchor fromText

Introduction

In this page you can find the example usage for com.intellij.openapi.wm ToolWindowAnchor fromText.

Prototype

@NotNull
    public static ToolWindowAnchor fromText(@Nullable String anchor) 

Source Link

Usage

From source file:com.android.tools.idea.uibuilder.layeredimage.LayersManager.java

License:Apache License

@Override
protected LightToolWindow createContent(@NotNull DesignerEditorPanelFacade designer) {
    if (!(designer instanceof LayeredImageEditorPanel)) {
        return null;
    }/* ww  w. j ava 2s. c  om*/

    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) {
        // If the inner component was removed we are bound to get a NPE during the LTW constructor.
        // 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);
}

From source file:com.intellij.designer.LightToolWindowManager.java

License:Apache License

@Nullable
final ToolWindowAnchor getEditorMode() {
    String value = myPropertiesComponent.getValue(myEditorModeKey);
    if (value == null) {
        return getAnchor();
    }//from w w  w.ja  v a 2 s. c  o m
    return value.equals("ToolWindow") ? null : ToolWindowAnchor.fromText(value);
}

From source file:org.cordovastudio.editors.designer.AbstractToolWindowManager.java

License:Apache License

@Nullable
public final ToolWindowAnchor getEditorMode() {
    String value = myPropertiesComponent.getValue(myEditorModeKey);
    if (value == null) {
        return getAnchor();
    }//from   w  w  w .  j a v a 2s . c  o  m
    return value.equals("ToolWindow") ? null : ToolWindowAnchor.fromText(value);
}