private void createTabItem(@NotNull IdeFrameImpl tabFrame, int index, boolean selection) {
    TabInfo info = new TabInfo(new JLabel());
    info.setObject(tabFrame).setText(tabFrame.getTitle()).setTooltipText(tabFrame.getTitle()); //NON-NLS
    info.setTabLabelActions(createTabActions(tabFrame), ActionPlaces.UNKNOWN);
    info.setDefaultForeground(JBUI.CurrentTheme.MainWindow.Tab.foreground(selection, false));

    addTab(info, index);

    if (selection) {
      select(info, true);

      WindowAdapter listener = new WindowAdapter() {
        @Override
        public void windowActivated(WindowEvent e) {
          repaint();
        }

        @Override
        public void windowDeactivated(WindowEvent e) {
          repaint();
        }
      };
      tabFrame.addWindowListener(listener);
      Disposer.register(myParentDisposable, () -> tabFrame.removeWindowListener(listener));
    }

    PropertyChangeListener listener = event -> info.setText((String)event.getNewValue()).setTooltipText((String)event.getNewValue());
    tabFrame.addPropertyChangeListener("title", listener);
    info.getComponent().putClientProperty(TITLE_LISTENER_KEY, listener);

    installTabDnd(info);
  }
private void createTabItem(@NotNull IdeFrameImpl tabFrame, int index, boolean selection)