PalettePanel (DesignerEditorPanel designer) { PaletteToolWindowManager manager = getInstance(designer.getProject()); if (manager.isEditorMode()) { return (PalettePanel)manager.getContent(designer); } return manager.myToolWindowPanel; }