Adds a Tab to the TabView instance.
If no index is specified, the tab is added to the end of the tab list.
@method addTab
@param {YAHOO.widget.Tab} tab A Tab instance to add.
@param {Integer} index The position to add the tab.
@return void
348713
function(tab, index) {
            var tabs = this.get('tabs'),
                before = this.getTab(index),
                tabParent = this._tabParent,
                contentParent = this._contentParent,
                tabElement = tab.get(ELEMENT),
                contentEl = tab.get(CONTENT_EL);

            if (!tabs) { // not ready yet
                this._queue[this._queue.length] = ['addTab', arguments];
                return false;
            }
            
            index = (index === undefined) ? tabs.length : index;
            
            tabs.splice(index, 0, tab);

            if ( before ) {
                tabParent.insertBefore(tabElement, before.get(ELEMENT));
            } else {
                tabParent.appendChild(tabElement);
            }

            if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {
                contentParent.appendChild(contentEl);
            }
            
            if ( !tab.get(ACTIVE) ) {
                tab.set('contentVisible', false, true); /* hide if not active */
            } else {
                this.set(ACTIVE_TAB, tab, true);
                this.set('activeIndex', index, true);
            }

            this._initTabEvents(tab);
        }
578820
function removeTab (tabData) {
    if (destroyed) return;
    var selectedIndex = ctrl.selectedIndex,
        tab           = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ];
    refreshIndex();
    // when removing a tab, if the selected index did not change, we have to manually trigger the
    //   tab select/deselect events
    if (ctrl.selectedIndex === selectedIndex) {
      tab.scope.deselect();
      ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();
    }
    $mdUtil.nextTick(function () {
      updatePagination();
      ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);
    });
  }
780704
function insertAt(parent, index, html) {
  console.log('inserting at ' + index + ' ' + html);
  console.log(parent);
  if (index === 0)
    return parent.prepend(html);
  parent.children(':nth-child(' + index + ')').after(html);
}
25298
def set_stack_index(self, index, instance):
        """"""
        if instance == self:
            self.tabwidget.setCurrentIndex(index)
710286
function (child, index) {
            var indexOffset = this._calculateIndexOffsetForChild(child);
            this.$parent.addChild(child, {childIndex: index + indexOffset});
        }
1101692
def addTab(self, elem, icon, name):
        
        self._widgets.append(elem)
        return super(TabWidget, self).addTab(elem, icon, name)
1067694
@Override
    public void add(int index, T element) {
        if (displacement != null) {
            super.add(index - displacement, element);
        } else {
            super.add(index, element);
        }
    }
1079512
public void setActiveIndices(final int[] indices) {
		TabSetModel model = getOrCreateComponentModel();

		if (indices == null || indices.length == 0) {
			model.activeTabs = null;
			return;
		}

		if (model.activeTabs == null) {
			model.activeTabs = new ArrayList<>(1);
		}

		model.activeTabs.clear();

		for (int index : indices) {
			model.activeTabs.add(index);
		}
	}
750449
def insertTab(self, index, tab):
        
        if not isinstance(tab, XViewPanelItem):
            tab = XViewPanelItem(tab, self)
            tab.setFixedHeight(self.height())

        # remove it from the layout first
        self.layout().insertWidget(index, tab)
        self.setCurrentIndex(index)
        return tab
711640
public void onNewTab(final AjaxRequestTarget target, final T tab)
	{
		getTabs().add(tab);
		setSelectedTab(getTabs().size() - 1);
		target.add(this);
	}
1206220
def addTab(self, tab):
        
        if not isinstance(tab, XViewPanelItem):
            tab = XViewPanelItem(tab, self)
            tab.setFixedHeight(self.height())

        index = len(self.items())
        self.layout().insertWidget(index, tab)

        self.setCurrentIndex(index)
        return tab
968557
def addTab(self, view, title):
        
        if not isinstance(view, XView):
            return False

        tab = self._tabBar.addTab(title)
        self.addWidget(view)
        tab.titleChanged.connect(view.setWindowTitle)
        
        # create connections
        try:
            view.windowTitleChanged.connect(self.refreshTitles,
                                            QtCore.Qt.UniqueConnection)
            view.sizeConstraintChanged.connect(self.adjustSizeConstraint,
                                            QtCore.Qt.UniqueConnection)
            view.poppedOut.connect(self.disconnectView,
                                   QtCore.Qt.UniqueConnection)
        except RuntimeError:
            pass
        
        self.setCurrentIndex(self.count() - 1)
        
        return True
417258
@Override
    public void setTitleAt(int index, String title) {
    	Component tabCom = this.getTabComponentAt(index);
    	if (tabCom != null && tabCom instanceof JPanel) {
    		Component c = ((JPanel)tabCom).getComponent(0);
			if (c != null && c instanceof JLabel) {
				((JLabel)c).setText(title);
			}
    	}
      else {
        super.setTitleAt(index, title);
      }
    }
870575
def insertTab(self, index, widget, title):
        
        self.insertWidget(index, widget)
        tab = self.tabBar().insertTab(index, title)
        tab.titleChanged.connect(widget.setWindowTitle)
818166
function( id ) {
			var tab = this._.tabs[ id ] && this._.tabs[ id ][ 0 ];
			if ( !tab || this._.pageCount == 1 || !tab.isVisible() )
				return;
			// Switch to other tab first when we're hiding the active tab.
			else if ( id == this._.currentTabId )
				this.selectPage( getPreviousVisibleTab.call( this ) );

			tab.hide();
			this._.pageCount--;
			this.updateStyle();
		}
148584
def addEmptyTab(self, text=''):
        
        tab = self.defaultTabWidget()
        c = self.count()
        self.addTab(tab, text)
        self.setCurrentIndex(c)
        if not text:
            self.tabBar().editTab(c)
        self.sigTabAdded.emit(tab)
        return tab
1001813
function(tab) {
            var index = null,
                tabs = this.get('tabs');
            for (var i = 0, len = tabs.length; i < len; ++i) {
                if (tab == tabs[i]) {
                    index = i;
                    break;
                }
            }
            
            return index;
        }