@Override
  public void layout() {
    Rectangle bounds = ui.getTabComponent().getBounds();
    Dimension idSize = isIdVisible() ? idLabel.getPreferredSize() : JBUI.emptySize();
    int eachX = 0;
    int eachY = 0;

    idLabel.setBounds(eachX, eachY, idSize.width, bounds.height);
    eachX += idSize.width;

    Dimension comboSize = comboLabel.getPreferredSize();
    int nonLabelWidth = getTabToolbarPreferredWidth();
    int spaceLeft = bounds.width - eachX - nonLabelWidth - (isToDrawCombo() && isIdVisible() ? 3 : 0);

    int width = comboSize.width;
    if (width > spaceLeft) {
      width = spaceLeft;
    }

    comboLabel.setBounds(eachX, eachY, width, bounds.height);
    eachX += width;

    // Tab toolbar is positioned at the end.
    ActionToolbar tabToolbar = ui.getTabToolbar();
    if (tabToolbar != null) {
      JComponent component = tabToolbar.getComponent();
      Dimension size = component.getPreferredSize();
      component.setBounds(eachX, eachY + (bounds.height - size.height) / 2, size.width, size.height);
      eachX += component.getWidth();
    }
  }
@Override
  public void layout()