public ActionCallback removeTabAt(
     final int componentIndex, int indexToSelect, boolean transferFocus) {
   TabInfo toSelect =
       indexToSelect >= 0 && indexToSelect < myTabs.getTabCount()
           ? myTabs.getTabAt(indexToSelect)
           : null;
   final TabInfo info = myTabs.getTabAt(componentIndex);
   // removing hidden tab happens on end of drag-out, we've already selected the correct tab for
   // this case in dragOutStarted
   if (info.isHidden()) {
     toSelect = null;
   }
   final ActionCallback callback = myTabs.removeTab(info, toSelect, transferFocus);
   return myProject.isOpen() ? callback : new ActionCallback.Done();
 }