Set's the selected tab to the one indexed by $index

Triggers the SelectedTabChanged event.

@param $tabIndex
439248
public function selectTabByIndex($tabIndex)
    {
        $this->model->selectedTab = $tabIndex;

        $this->selectedTabChangedEvent->raise($tabIndex);

        $this->onSelectedTabChanged($tabIndex);
    }
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
339081
protected void doClose(int tabIndex) {
        if (tabCloseListener == null || tabCloseListener.tabAboutToBeClosed(tabIndex)) {
            String    title     = tabPane.getTitleAt(tabIndex);
            Component component = tabPane.getComponentAt(tabIndex);

            tabPane.removeTabAt(tabIndex);

            if (tabCloseListener != null) {
                tabCloseListener.tabClosed(title, component);
            }
        }
    }
1234810
public function addTab(string $id, array $tab): void
	{
		$this->optionTabs[] = array_merge($tab, ['DIV' => $id]);
	}
693260
public function setTabs($tabs)
    {
        if (is_callable($tabs)) {
            $tabs = call_user_func($tabs, $this);
        }

        return $this->setElements($tabs);
    }
594999
public void setEvent(int index, int event) {
        if (events == null || index < 0 || index >= events.length) {
            throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
        }

        events[index] = (byte)event;
    }
87887
public function setTabContent(array $tab)
    {
        if($tab && is_array($tab)) {
            
            foreach($tab as $attrib => $values)
            {
                $this->_tabs .= '<li><a href="#'.$values['id'].'" class="'.$values['class'].'" data-toggle="tab"><i></i><span class="strong">'.$values['tab-header'].'</span>'.$values['tab-text'].'</a></li>';
            }
            $this->setContent($tab);
        }
    }
1249109
protected void switchTab() {

        Component tab = m_tab.getSelectedTab();
        int pos = m_tab.getTabPosition(m_tab.getTab(tab));
        if (m_isWebOU) {
            if (pos == 0) {
                pos = 1;
            }
        }
        m_tab.setSelectedTab(pos + 1);
    }
157334
function selectTab() {
      var href = tab.href.split('#')[1];
      var panel = layout.content_.querySelector('#' + href);
      layout.resetTabState_(tabs);
      layout.resetPanelState_(panels);
      tab.classList.add(layout.CssClasses_.IS_ACTIVE);
      panel.classList.add(layout.CssClasses_.IS_ACTIVE);
    }
706459
function(tab) {
            var tabCount = this.get('tabs').length,
                index = this.getTabIndex(tab);

            if ( tab === this.get(ACTIVE_TAB) ) { 
                if (tabCount > 1) { // select another tab
                    if (index + 1 === tabCount) { // if last, activate previous
                        this.set(ACTIVE_INDEX, index - 1);
                    } else { // activate next tab
                        this.set(ACTIVE_INDEX, index + 1);
                    }
                } else { // no more tabs
                    this.set(ACTIVE_TAB, null);
                }
            }
            
            this._removeTabEvents(tab);
            this._tabParent.removeChild( tab.get(ELEMENT) );
            this._contentParent.removeChild( tab.get(CONTENT_EL) );
            this._configs.tabs.value.splice(index, 1);

            tab.fireEvent('remove', { type: 'remove', tabview: this });
        }
1127723
function () {
            this.changeProperty("selectedTab", this._cfg.tabId);
            if (this._cfg.waiAria) {
                // Focusing the Tab before focusing the TabPanel is not enough to make the screen reader read the tab's title first
                // A sufficient timeout would be necessary, but we can't program that way safely
                // this._focus();
                var controlledTabPanelId = this._getControlledTabPanelId();
                if (controlledTabPanelId != null) {
                    var tabPanelElement = ariaUtilsDom.getElementById(controlledTabPanelId);
                    ariaTemplatesNavigationManager.focusFirst(tabPanelElement);
                }
            }
        }
1049512
public function setSessionIndex(string $sessionIndex = null) : void
    {
        if (is_null($sessionIndex)) {
            $this->sessionIndexes = [];
        } else {
            $this->sessionIndexes = [$sessionIndex];
        }
    }
66621
public function setActiveSelectionByIndex($iIdx)
    {
        if (($aSelections = $this->getSelections())) {
            $iSelIdx = 0;
            foreach ($aSelections as $oSelection) {
                $oSelection->setActiveState($iSelIdx == $iIdx);
                if ($iSelIdx == $iIdx) {
                    $this->_oActiveSelection = $oSelection;
                }
                $iSelIdx++;
            }
        }
    }
300114
function insertTab (tabData, index) {
    var hasLoaded = loaded;
    var proto = {
          getIndex:     function () { return ctrl.tabs.indexOf(tab); },
          isActive:     function () { return this.getIndex() === ctrl.selectedIndex; },
          isLeft:       function () { return this.getIndex() < ctrl.selectedIndex; },
          isRight:      function () { return this.getIndex() > ctrl.selectedIndex; },
          shouldRender: function () { return !ctrl.noDisconnect || this.isActive(); },
          hasFocus:     function () {
            return ctrl.styleTabItemFocus
                && ctrl.hasFocus && this.getIndex() === ctrl.focusIndex;
          },
          id:           $mdUtil.nextUid(),
          hasContent: !!(tabData.template && tabData.template.trim())
    };
    var tab = angular.extend(proto, tabData);

    if (angular.isDefined(index)) {
      ctrl.tabs.splice(index, 0, tab);
    } else {
      ctrl.tabs.push(tab);
    }
    processQueue();
    updateHasContent();

    $mdUtil.nextTick(function () {
      updatePagination();
      setAriaControls(tab);

      // if autoselect is enabled, select the newly added tab
      if (hasLoaded && ctrl.autoselect) {
        $mdUtil.nextTick(function () {
          $mdUtil.nextTick(function () { select(ctrl.tabs.indexOf(tab)); });
        });
      }
    });
    return tab;
  }
395072
final protected function setIndex($index)
    {
        $this->model->leafIndex = $index;
        $this->model->updatePath();
        // Signal to all or any sub leaves that need to recompute their own path now.
        $this->leafPathChanged();
    }
196423
public void setTabText(int index, String text) {
        TextView tv = (TextView) mTabTitleViews.get(index);

        if (tv != null) {
            tv.setText(text);
        }
    }
1172249
function setTabIndex(elements) {
  for (let i = 0; i < elements.length; ++i) {
    if (elements[i].nodeName.toLowerCase() === "label" && elements[i].firstChild.nodeName.toLowerCase() === "input") {
      elements[i].firstChild.tabIndex = i;
    } else {
      elements[i].tabIndex = i;
    }
  }
}