@Override
  protected @NotNull TabLabel createTabLabel(@NotNull TabInfo info) {
    return new TabLabel(this, info) {
      {
        for (MouseListener listener : getMouseListeners()) {
          removeMouseListener(listener);
        }
        TabLabel label = this;
        addMouseListener(new MouseAdapter() {
          @Override
          public void mousePressed(MouseEvent e) {
            if (!UIUtil.isCloseClick(e, MouseEvent.MOUSE_PRESSED) && !_isSelectionClick(e)) {
              handlePopup(e);
            }
          }

          @Override
          public void mouseReleased(MouseEvent e) {
            handlePopup(e);
          }

          @Override
          public void mouseClicked(MouseEvent e) {
            if (_isSelectionClick(e)) {
              Component c = SwingUtilities.getDeepestComponentAt(e.getComponent(), e.getX(), e.getY());
              if (c instanceof InplaceButton) return;
              tabs.select(info, true);
              JBPopup container = PopupUtil.getPopupContainerFor(label);
              if (container != null && ClientProperty.isTrue(container.getContent(), MorePopupAware.class)) {
                container.cancel();
              }
            }
            else if (e.getButton() == MouseEvent.BUTTON2) {
              closeTab((IdeFrameImpl)getInfo().getObject(), false);
            }
            else {
              handlePopup(e);
            }
          }

          @Override
          public void mouseEntered(MouseEvent e) {
            setHovered(true);
          }

          @Override
          public void mouseExited(MouseEvent e) {
            setHovered(false);
          }
        });
      }

      @Override
      public Dimension getPreferredSize() {
        return new Dimension(super.getPreferredSize().width, JBUI.scale(TAB_HEIGHT));
      }

      @Override
      public void setTabActions(ActionGroup group) {
        super.setTabActions(group);
        if (actionPanel != null) {
          Container parent = actionPanel.getParent();
          parent.remove(actionPanel);
          parent.add(new Wrapper(actionPanel) {
            @Override
            public Dimension getPreferredSize() {
              return actionPanel.getPreferredSize();
            }
          }, BorderLayout.WEST);

          actionPanel.setBorder(JBUI.Borders.emptyLeft(6));
          actionPanel.setVisible(!showCloseActionOnHover());
        }
      }

      @Override
      protected void setHovered(boolean value) {
        super.setHovered(value);
        if (actionPanel != null) {
          actionPanel.setVisible(!showCloseActionOnHover() || value || getInfo() == tabs.getPopupInfo());
        }
      }

      @Override
      protected void handlePopup(MouseEvent e) {
        super.handlePopup(e);
        JPopupMenu popup = tabs.getActivePopup();
        if (popup != null) {
          popup.addPopupMenuListener(new PopupMenuListenerAdapter() {
            @Override
            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
              handle();
            }

            @Override
            public void popupMenuCanceled(PopupMenuEvent e) {
              handle();
            }

            private void handle() {
              popup.removePopupMenuListener(this);
              actionPanel.setVisible(!showCloseActionOnHover() || isHovered());
            }
          });
        }
      }

      @Override
      protected boolean isTabActionsOnTheRight() {
        return false;
      }

      @Override
      protected boolean shouldPaintFadeout() {
        return false;
      }
    };
  }
@Override
  protected @NotNull TabLabel createTabLabel(@NotNull TabInfo info)