switchToWindow switch to an other Window.
779012
private void switchToWindow(String key, String handleToKeep) {
        Context.addWindow(key, handleToKeep);
        Context.setMainWindow(key);
        Context.getDriver().switchTo().window(handleToKeep);
    }
285974
private void adaptSwitch() {
        if (switchWidget != null) {
            switchWidget.setTextOn(getSwitchTextOn());
            switchWidget.setTextOff(getSwitchTextOff());
            switchWidget.setShowText(!TextUtils.isEmpty(getSwitchTextOn()) ||
                    !TextUtils.isEmpty(getSwitchTextOff()));
            switchWidget.setChecked(isChecked());
        }
    }
1358955
function (e) {
		const key = extractKey(e);
		if (key === TOGGLE_DEV_TOOLS_KB || key === TOGGLE_DEV_TOOLS_KB_ALT) {
			ipc.send('vscode:toggleDevTools');
		} else if (key === RELOAD_KB) {
			ipc.send('vscode:reloadWindow');
		}
	}
215387
public void switchToParentFrame() {
        if (!currentIFramePath.isEmpty()) {
            // copy path since substring creates a view, not a deep copy
            List<T> newPath = currentIFramePath.subList(0, currentIFramePath.size() - 1);
            newPath = new ArrayList<T>(newPath);
            // Safari and PhantomJs don't support switchTo.parentFrame, so we do this
            // it works for Phantom, but is VERY slow there (other browsers are slow but ok)
            switchToDefaultContent();
            for (T iframe : newPath) {
                switchToFrame(iframe);
            }
        }
    }
788050
private void changeGuiActive( final boolean error , final boolean reverse ) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				control.setActiveGui(error,reverse);
			}
		});
	}
1062276
def InternalPlatformSwitch(funcname, *args, **kwargs):
  """"""
  # pylint: disable=g-import-not-at-top
  clz = None
  if sys.platform.startswith('linux'):
    from pyu2f.hid import linux
    clz = linux.LinuxHidDevice
  elif sys.platform.startswith('win32'):
    from pyu2f.hid import windows
    clz = windows.WindowsHidDevice
  elif sys.platform.startswith('darwin'):
    from pyu2f.hid import macos
    clz = macos.MacOsHidDevice

  if not clz:
    raise Exception('Unsupported platform: ' + sys.platform)

  if funcname == '__init__':
    return clz(*args, **kwargs)
  return getattr(clz, funcname)(*args, **kwargs)
683247
def _switch(self, future):
        """"""
        scoop._control.current = self
        assert self.greenlet is not None, ("No greenlet to switch to:"
                                           "\n{0}".format(self.__dict__))
        return self.greenlet.switch(future)
931302
def OnCut(self, event):
        """"""

        entry_line = \
            self.main_window.entry_line_panel.entry_line_panel.entry_line

        if wx.Window.FindFocus() != entry_line:
            selection = self.main_window.grid.selection

            with undo.group(_("Cut")):
                data = self.main_window.actions.cut(selection)

            self.main_window.clipboard.set_clipboard(data)

            self.main_window.grid.ForceRefresh()

        else:
            entry_line.Cut()

        event.Skip()
821499
def setup_other_windows(self):
        """"""

        self.toolbar_list = ((_("File toolbar"), "file_toolbar",
                              self.main.file_toolbar_actions),
                             (_("Search toolbar"), "search_toolbar",
                              self.main.search_menu_actions),
                             (_("Source toolbar"), "source_toolbar",
                              self.main.source_toolbar_actions),
                             (_("Run toolbar"), "run_toolbar",
                              self.main.run_toolbar_actions),
                             (_("Debug toolbar"), "debug_toolbar",
                              self.main.debug_toolbar_actions),
                             (_("Edit toolbar"), "edit_toolbar",
                              self.main.edit_toolbar_actions))
        self.menu_list = ((_("&File"), self.main.file_menu_actions),
                          (_("&Edit"), self.main.edit_menu_actions),
                          (_("&Search"), self.main.search_menu_actions),
                          (_("Sour&ce"), self.main.source_menu_actions),
                          (_("&Run"), self.main.run_menu_actions),
                          (_("&Tools"), self.main.tools_menu_actions),
                          (_("&View"), []),
                          (_("&Help"), self.main.help_menu_actions))
        # Create pending new windows:
        for layout_settings in self.editorwindows_to_be_created:
            win = self.create_new_window()
            win.set_layout_settings(layout_settings)
542635
function SwitchRW(valrw, cases, opts) {
    if (!(this instanceof SwitchRW)) {
        return new SwitchRW(valrw, cases, opts);
    }
    opts = opts || {};
    this.valrw = valrw;
    this.cases = cases;
    this.cons = opts.cons || Pair;
    this.valKey = opts.valKey || '0';
    this.dataKey = opts.dataKey || '1';
    // istanbul ignore if TODO
    if (opts.structMode) {
        this.poolReadFrom = this.structReadFrom;
    }

    BufferRW.call(this);
}
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
776605
def close_other_windows(self):
        
        main_window_handle = self.current_window_handle
        for window_handle in self.window_handles:
            if window_handle == main_window_handle:
                continue
            self.switch_to_window(window_handle)
            self.close()
        self.switch_to_window(main_window_handle)
904655
private void switchToBackward() {
        assert((checkDir > 0 && seq == rawSeq) || (checkDir == 0 && pos == start));
        if(checkDir > 0) {
            // Turn around from forward checking.
            limit = segmentLimit = pos;
            if(pos == segmentStart) {
                start = rawStart;
                checkDir = -1;  // Check backward.
            } else {  // pos > segmentStart
                checkDir = 0;  // Stay in FCD segment.
            }
        } else {
            // Reached the start of the FCD segment.
            if(seq == rawSeq) {
                // The input text segment is FCD, extend it backward.
            } else {
                // The input text segment needed to be normalized.
                // Switch to checking backward from it.
                seq = rawSeq;
                pos = limit = segmentLimit = segmentStart;
            }
            start = rawStart;
            checkDir = -1;
        }
    }
466400
def switch(self, idx, control):
        """"""
        old = None
        new = None
        if control == 'Q':
            if self.PQ[idx] == 1:
                old = 'PQ'
                new = 'PV'
            elif self.vQ[idx] == 1:
                old = 'vQ'
                new = 'vV'
        elif control == 'P':
            if self.PQ[idx] == 1:
                old = 'PQ'
                new = 'vQ'
            elif self.PV[idx] == 1:
                old = 'PV'
                new = 'vV'
        elif control == 'V':
            if self.PV[idx] == 1:
                old = 'PV'
                new = 'PQ'
            elif self.vV[idx] == 1:
                old = 'vV'
                new = 'vQ'
        elif control == 'v':
            if self.vQ[idx] == 1:
                old = 'vQ'
                new = 'PQ'
            elif self.vV[idx] == 1:
                old = 'vV'
                new = 'PV'
        if old and new:
            self.__dict__[old][idx] = 0
            self.__dict__[new][idx] = 1
386568
private Environment switchEnvironment(Environment env) {
    Environment prev = currentEnvironment;
    currentEnvironment = env;
    return prev;
  }
80554
private Scope switchScope(Scope scope) {
    Scope prev = currentScope;
    currentScope = scope;
    return prev;
  }
370872
private void sawSwitch(int pc) {
        int[] offsets = getSwitchOffsets();
        List<Integer> targets = new ArrayList<>(offsets.length);
        for (int offset : offsets) {
            targets.add(Integer.valueOf(offset + pc));
        }
        Integer defOffset = Integer.valueOf(getDefaultSwitchOffset() + pc);
        if (!targets.contains(defOffset)) {
            targets.add(defOffset);
        }
        Collections.sort(targets);

        Integer lastTarget = targets.get(0);
        for (int i = 1; i < targets.size(); i++) {
            Integer nextTarget = targets.get(i);
            ScopeBlock sb = new ScopeBlock(lastTarget.intValue(), nextTarget.intValue());
            sb.setCase();
            rootScopeBlock.addChild(sb);
            lastTarget = nextTarget;
        }
        for (Integer target : targets) {
            switchTargets.set(target.intValue());
        }
    }