code: public SequentialTransition addTab(int idx, final Dockable tab) {
  
          final SequentialTransition seq = new SequentialTransition();
  
          final ToggleButton b = new ToggleButton(tab.name());// , new ImageView(model().getBehavior(DockableBehavior.class).modelIcon()));
          b.setToggleGroup(this.group);
          // b.getStyleClass().clear();
          b.setUserData(tab);
  
          final ToggleButton oldButton = this.buttonByTab.put(tab.name(), b);
          final int previousIndex = this.box.getChildren().indexOf(oldButton);
          if (previousIndex >= 0 && previousIndex < idx) {
              idx++;
          }
  
          selectTab(tab);
  
          controller().initTabEventHandler(b);
  
          if (idx < 0 || idx > this.box.getChildren().size()) {
              idx = this.box.getChildren().size();
          }
  
          b.setScaleX(0.0);
          this.box.getChildren().add(idx, b);
  
          if (this.box instanceof HBox) {
              HBox.setMargin(b, new Insets(0, 1, 0, 0));
          } else if (this.box instanceof VBox) {
              VBox.setMargin(b, new Insets(1, 0, 0, 0));
          }
  
          final ScaleTransition st = new ScaleTransition(Duration.millis(600));
          st.setNode(b);
          st.setFromX(0.0);
          st.setToX(1.0);
  
          seq.getChildren().add(st);
  
          return seq;
      }
docs: Adds the tab.
  
  @param idx the idx
  @param tab the tab