DesignerToolWindow (DesignerEditorPanel designer) { DesignerToolWindowManager manager = getInstance(designer.getProject()); if (manager.isEditorMode()) { return (DesignerToolWindow)manager.getContent(designer); } return manager.myToolWindowContent; }