Return the widget to give focus to when
        this plugin's dockwidget is raised on top-level
976080
def get_focus_widget(self):
        
        self.pydocbrowser.url_combo.lineEdit().selectAll()
        return self.pydocbrowser.url_combo
592054
def setCentralWidget(self, widget):
        
        self.setEnabled(widget is not None)
        self._popupWidget.setCentralWidget(widget)
332257
function checkPanelPosition() {
        const currentPanelRect = panel.getBoundingClientRect();

        if (currentPanelRect.top + currentPanelRect.height > getScrollContainerHeight() &&
          !isDocked) {
          dock();
        } else if (
          isDocked &&
          currentPanelRect.top + currentPanelRect.height +
            getScrollContainerScrollTop() >= getInitialUndockedPosition() + TOGGLE_GAP
        ) {
          undock();
        }
      }
967824
def get_widget(self, index=None, path=None, tabs=None):
        
        if (index and tabs) or (path and tabs):
            return tabs.widget(index)
        elif self.plugin:
            return self.get_plugin_tabwidget(self.plugin).currentWidget()
        else:
            return self.plugins_tabs[0][0].currentWidget()
369017
def setCurrentPlugin( self, plugin ):
        
        item = self.uiWizardTABLE.currentItem()
        if ( not item ):
            return None
        
        return item.plugin()
1245092
def createWidget( self, parent ):
        
        widget = self.widgetClass()(parent, self.uiFile())
        widget.setPlugin(self)
        return widget
1189107
def focusIn(self, event=None):
        """"""
        try:
            # doScroll returns false if the call was ignored because the
            # last call also came from this widget.  That avoids unwanted
            # scrolls and text selection when the focus moves in and out
            # of the window.
            if self.doScroll(event):
                self.entry.selection_range(0, END) # select all text in widget
            else:
                # restore selection to what it was on the last FocusOut
                if self.lastSelection:
                    self.entry.selection_range(*self.lastSelection)
        except AttributeError:
            pass
494081
def popupWidget(self):
        
        if not self._popup:
            btns = QDialogButtonBox.Save | QDialogButtonBox.Cancel
            self._popup = XPopupWidget(self, btns)
            self._popup.setShowTitleBar(False)
            self._popup.setAutoCalculateAnchor(True)
            self._popup.setPositionLinkedTo(self)
        return self._popup
670481
def dockWidget(self, widget, title, area):
        
        assert widget.parent() is None, "Widget already has a parent"

        dockWidget = QtWidgets.QDockWidget(title, parent=self)
        dockWidget.setObjectName("dock_" + string_to_identifier(title))
        dockWidget.setWidget(widget)

        # Prevent parent context menu (with e.g. 'set inspector" option) to be displayed.
        dockWidget.setContextMenuPolicy(Qt.PreventContextMenu)

        self.addDockWidget(area, dockWidget)
        self.viewMenu.addAction(dockWidget.toggleViewAction())
        return dockWidget
565447
function () {
            var touchFocusSpan = this._touchFocusSpan;
            if (!touchFocusSpan) {
                touchFocusSpan = this._touchFocusSpan = Aria.$window.document.createElement("span");
                touchFocusSpan.setAttribute("tabIndex", "-1");
                var widgetDomElt = this.getDom();
                widgetDomElt.appendChild(touchFocusSpan);
            }
            touchFocusSpan.focus();
        }
797666
def focusOutEvent(self, ev):
        """"""
        Kittens.widgets.ClickableTreeWidget.focusOutEvent(self, ev)
        # if focus is going to a child of ours, do nothing
        wid = QApplication.focusWidget()
        while wid:
            if wid is self:
                return
            wid = wid.parent()
        # else we're truly losing focus -- stop the editor
        self._startOrStopEditing()
1181921
def change_last_focused_widget(self, old, now):
        """"""
        if (now is None and QApplication.activeWindow() is not None):
            QApplication.activeWindow().setFocus()
            self.last_focused_widget = QApplication.focusWidget()
        elif now is not None:
            self.last_focused_widget = now

        self.previous_focused_widget =  old
74198
def create_widget(self):
        
        d = self.declaration
        self.widget = Switch(self.get_context(), None,
                             d.style or '@attr/switchStyle')
877748
def create_dockwidget(self):
        """"""
        # Creating dock widget
        dock = SpyderDockWidget(self.get_plugin_title(), self.main)

        # Set properties
        dock.setObjectName(self.__class__.__name__+"_dw")
        dock.setAllowedAreas(self.ALLOWED_AREAS)
        dock.setFeatures(self.FEATURES)
        dock.setWidget(self)
        self.update_margins()
        dock.visibilityChanged.connect(self.visibility_changed)
        dock.topLevelChanged.connect(self.on_top_level_changed)
        dock.sig_plugin_closed.connect(self.plugin_closed)
        self.dockwidget = dock
        if self.shortcut is not None:
            sc = QShortcut(QKeySequence(self.shortcut), self.main,
                            self.switch_to_plugin)
            self.register_shortcut(sc, "_", "Switch to %s" % self.CONF_SECTION)
        return (dock, self.LOCATION)
579256
def get_focus_client(self):
        """"""
        widget = QApplication.focusWidget()
        for client in self.get_clients():
            if widget is client or widget is client.notebookwidget:
                return client
930141
def add_widget(self):
        

        LOGGER.debug("> Adding '{0}' Component Widget.".format(self.__class__.__name__))

        self.__engine.addDockWidget(Qt.DockWidgetArea(self.__dock_area), self)

        return True
313234
function (div) {
        var visWidget = vis.views[vis.activeView].widgets[barsIntern.wid];
        if (visWidget === undefined) {
            for (var view in vis.views) {
                if (view === '___settings') continue;
                if (vis.views[view].widgets[barsIntern.wid]) {
                    visWidget = vis.views[view].widgets[barsIntern.wid];
                    break;
                }
            }
        }

        return visWidget;
    }