void () { if (myToolWindowPanel == null) { myToolWindowPanel = new PalettePanel(); Disposer.register(this, () -> myToolWindowPanel.dispose()); } myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow("Palette\t", false, getAnchor(), myProject, true); myToolWindow.setIcon(AllIcons.Toolwindows.ToolWindowPalette); initGearActions(); ContentManager contentManager = myToolWindow.getContentManager(); Content content = contentManager.getFactory().createContent(myToolWindowPanel, null, false); content.setCloseable(false); content.setPreferredFocusableComponent(myToolWindowPanel); contentManager.addContent(content); contentManager.setSelectedContent(content, true); myToolWindow.setAvailable(false); }