@Override
  protected void initToolWindow() {
    myToolWindowPanel = new PaletteWindow(myProject);
    Disposer.register(this, () -> myToolWindowPanel.dispose());

    myToolWindow = ToolWindowManager.getInstance(myProject)
      .registerToolWindow(IdeBundle.message("toolwindow.palette"), false, getAnchor(), this, 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);
  }
@Override
  protected void initToolWindow()