switcher between the navtabs for operating systems
962917
function selectOSTab(target, osName) {
  // Declare all variables
  var i, tabcontent, tablinks;

  // Get all elements with class="tabcontent" and hide them
  tabcontent = document.getElementsByClassName("tabcontent");
  for (i = 0; i < tabcontent.length; i++) {
    tabcontent[i].style.display = "none";
  }

  // Get all elements with class="tablinks" and remove the class "active"
  tablinks = document.getElementsByClassName("tablinks");
  for (i = 0; i < tablinks.length; i++) {
    tablinks[i].className = tablinks[i].className.replace(" active", "");
  }

  // Show the current tab, and add an "active" class to the link that opened the tab
  document.getElementById(osName).style.display = "block";
  target.className += " active";
}
1291453
def tab_navigation_mru(self, forward=True):
        
        self.tabs_switcher = TabSwitcherWidget(self, self.stack_history,
                                               self.tabs)
        self.tabs_switcher.show()
        self.tabs_switcher.select_row(1 if forward else -1)
        self.tabs_switcher.setFocus()
397066
function trapTabs(parentElement) {
		if (parentElement.tabTrapInstalled)
			return;
		
		parentElement.addEventListener("keydown", function (e) { //$NON-NLS-0$
			if(e.keyCode === KEY.TAB) {
				var first = firstTabbable(parentElement);
				var last = lastTabbable(parentElement);
				
				if (first && last) {
					if (e.target === last && !e.shiftKey) {
						// wrap to first tabbable
						first.focus();
						stop(e);
					}
					else if (e.target === first && e.shiftKey) {
						// wrap to last tabbable
						last.focus();
						stop(e);
					}
				}
			} 
		}, true);
		parentElement.tabTrapInstalled = true;
	}
310818
def AltTab(self, n=1, delay=0):
        
        self._delay(delay)
        self.add(Command("KeyDown", 'KeyDown "%s", %s' % (BoardKey.Alt, 1)))
        for i in range(n):
            self.add(Command("KeyPress", 'KeyPress "%s", %s' % (BoardKey.Tab, 1)))
        self.add(Command("KeyUp", 'KeyUp "%s", %s' % (BoardKey.Alt, 1)))
1342168
function matchTabWindow(tabWindow, searchExp) {
  var itemMatches = tabWindow.tabItems.map(function (ti) {
    return matchTabItem(ti, searchExp);
  }).filter(function (fti) {
    return fti !== null;
  });
  var titleMatches = tabWindow.title.match(searchExp);

  if (titleMatches === null && itemMatches.count() === 0) {
    return null;
  }

  return FilteredTabWindow({ tabWindow: tabWindow, titleMatches: titleMatches, itemMatches: itemMatches });
}
205023
def navigator(self):
        
        if self._navigator is None:
            self._navigator = nav = XOrbColumnNavigator()
            self.lineEdit().setCompleter(None)
            
            # initialize settings
            nav.hide()
            nav.header().hide()
            nav.setWindowFlags(Qt.Popup)
            nav.setFocusPolicy(Qt.ClickFocus)
            nav.installEventFilter(self)
            nav.setVerticalScrollMode(nav.ScrollPerPixel)
            
            # create connections
            nav.itemClicked.connect(self.acceptColumn)
            self.lineEdit().textEdited.connect(self.showPopup)
            nav.schemaColumnChanged.connect(self.emitSchemaColumnChanged)
        
        return self._navigator
284046
def update_browse_tabs_menu(self):
        """"""
        self.browse_tabs_menu.clear()
        names = []
        dirnames = []
        for index in range(self.count()):
            if self.menu_use_tooltips:
                text = to_text_string(self.tabToolTip(index))
            else:
                text = to_text_string(self.tabText(index))
            names.append(text)
            if osp.isfile(text):
                # Testing if tab names are filenames
                dirnames.append(osp.dirname(text))
        offset = None
        
        # If tab names are all filenames, removing common path:
        if len(names) == len(dirnames):
            common = get_common_path(dirnames)
            if common is None:
                offset = None
            else:
                offset = len(common)+1
                if offset <= 3:
                    # Common path is not a path but a drive letter...
                    offset = None

        for index, text in enumerate(names):
            tab_action = create_action(self, text[offset:],
                                       icon=self.tabIcon(index),
                                       toggled=lambda state, index=index:
                                               self.setCurrentIndex(index),
                                       tip=self.tabToolTip(index))
            tab_action.setChecked(index == self.currentIndex())
            self.browse_tabs_menu.addAction(tab_action)
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);
                }
            }
        }
700491
function onTab(
    event: *,
    change: Change,
    editor: *,
    opts: Options
): void | Change {
    event.preventDefault();
    const { value } = change;
    const direction = event.shiftKey ? -1 : +1;

    // Create new row if needed
    const { startKey, selection } = value;
    const pos = TablePosition.create(opts, value.document, startKey);
    if (pos.isFirstCell() && direction === -1) {
        insertRow(opts, change, 0);
    } else if (pos.isLastCell() && direction === 1) {
        insertRow(opts, change);
    }

    // Move back to initial cell (insertRow moves selection automatically).
    change.select(selection);

    // Move
    moveSelectionBy(opts, change, direction, 0);

    // Select all cell.
    return selectAllText(change);
}
474059
def tabActiveMarkupChanged(self, tab):
		'''
		
		'''
		if tab == self.currentTab:
			markupClass = tab.getActiveMarkupClass()
			dtMarkdown = (markupClass == markups.MarkdownMarkup)
			dtMkdOrReST = dtMarkdown or (markupClass == markups.ReStructuredTextMarkup)
			self.formattingBox.setEnabled(dtMarkdown)
			self.symbolBox.setEnabled(dtMarkdown)
			self.actionUnderline.setEnabled(dtMarkdown)
			self.actionBold.setEnabled(dtMkdOrReST)
			self.actionItalic.setEnabled(dtMkdOrReST)
929414
public void switchWindow() {
        List<String> windowHandles = new ArrayList<>(getWindowHandles());
        getDriver().switchTo().window(windowHandles.get(windowHandles.size() - 1));
    }
995625
def switchCurrentView(self, viewType):
        
        if not self.count():
            return self.addView(viewType)

        # make sure we're not trying to switch to the same type
        view = self.currentView()
        if type(view) == viewType:
            return view

        # create a new view and close the old one
        self.blockSignals(True)
        self.setUpdatesEnabled(False)

        # create the new view
        index = self.indexOf(view)
        if not view.close():
            return None
        #else:
        #    self.tabBar().removeTab(index)

        index = self.currentIndex()
        new_view = viewType.createInstance(self.viewWidget(), self.viewWidget())

        # add the new view
        self.insertTab(index, new_view, new_view.windowTitle())

        self.blockSignals(False)
        self.setUpdatesEnabled(True)
        self.setCurrentIndex(index)

        return new_view
23851
def accel_move_tab_left(self, *args):
        # TODO KEYBINDINGS ONLY
        
        pos = self.get_notebook().get_current_page()
        if pos != 0:
            self.move_tab(pos, pos - 1)
        return True
156015
function mapDispatchToProps(dispatch) {
  return {
    onChangeArr: (arr) => dispatch(changeArr(arr)),
    onChangeFoo: (foo) => dispatch(changeFoo(foo)),
    onChangeBar: (bar) => dispatch(changeBar(bar)),
    onChangeBaz: (baz) => dispatch(changeBaz(baz)),
    onChangeMany: (foo) => dispatch(changeMany({ foo })),
  };
}
713647
function focusTab(tabId) {
    var updateProperties = { "active": true };
    chrome.tabs.update(tabId, updateProperties, function (tab) { });
  }
885963
function filterTabWindows(tabWindows, searchExp) {
  var res;
  if (searchExp === null) {
    res = _.map(tabWindows, function (tw) {
      return new FilteredTabWindow({ tabWindow: tw });
    });
  } else {
    var mappedWindows = _.map(tabWindows, function (tw) {
      return matchTabWindow(tw, searchExp);
    });
    res = _.filter(mappedWindows, function (fw) {
      return fw !== null;
    });
  }

  return res;
}
1280594
def tab_under_menu(self):
        
        if self._menu_pos:
            return self.tabBar().tabAt(self._menu_pos)
        else:
            return self.currentIndex()