ToggleEditorModeAction (ToolWindowAnchor anchor) { return new ToggleEditorModeAction(this, myProject, anchor) { @Override protected LightToolWindowManager getOppositeManager() { AbstractToolWindowManager designerManager = DesignerToolWindowManager.getInstance(myProject); AbstractToolWindowManager paletteManager = PaletteToolWindowManager.getInstance(myProject); return myManager == designerManager ? paletteManager : designerManager; } }; }