@Override
  public void contentAdded(@NotNull ContentManagerEvent event) {
    Content content = event.getContent();
    ContentTabLabel tab;
    if (content instanceof TabbedContent) {
      tab = new TabbedContentTabLabel((TabbedContent)content, this);
    }
    else {
      tab = new ContentTabLabel(content, this);
    }
    tabs.add(Math.min(event.getIndex(), tabs.size()), tab);
    contentToTabs.put(content, tab);

    DnDTarget target = getDnDTarget(content);
    if (target != null) {
      DnDSupport.createBuilder(tab)
        .setDropHandler(target)
        .setTargetChecker(target)
        .setCleanUpOnLeaveCallback(() -> target.cleanUpOnLeave())
        .install();
    }
  }
@Override
  public void contentAdded(@NotNull ContentManagerEvent event)