Internal helper, logic invoked when a component gains focus
500401
def handle_focused
      ch = nil

      focused.dispatch :focused
      update_focus

      if focused.activate_focus?
        focused.activate!

      elsif focused.kind_of?(Layout)
        ch = focused.handle_input(true)

      elsif !deactivate? && !nav_select
        ch = sync_getch
      end

      if self.ch_select
        ch = self.ch_select
        self.ch_select = nil
      end

      ch
    end
798663
function(bLoading) {
			var oTrigger = this._oTrigger,
				oControl = this._oControl;

			// If there are no visible columns then also hide the trigger.
			if (!oTrigger || !oControl || !oControl.shouldRenderItems() || !oControl.getDomRef()) {
				return;
			}

			var oBinding = oControl.getBinding("items");
			if (!oBinding) {
				return;
			}

			// update busy state
			oTrigger.setBusy(bLoading);
			oTrigger.$().toggleClass("sapMGrowingListBusyIndicatorVisible", bLoading);

			if (bLoading) {
				oTrigger.setActive(false);
				oControl.$("triggerList").css("display", "");
			} else {
				var aItems = oControl.getItems(true),
					iItemsLength = aItems.length,
					iBindingLength = oBinding.getLength() || 0,
					bLengthFinal = oBinding.isLengthFinal(),
					bHasScrollToLoad = oControl.getGrowingScrollToLoad(),
					oTriggerDomRef = oTrigger.getDomRef();

				// put the focus to the newly added item if growing button is pressed
				if (oTriggerDomRef && oTriggerDomRef.contains(document.activeElement)) {
					(aItems[this._iLastItemsCount] || oControl).focus();
				}

				// show, update or hide the growing button
				if (!iItemsLength || !this._iLimit ||
					(bLengthFinal && this._iLimit >= iBindingLength) ||
					(bHasScrollToLoad && this._getHasScrollbars())) {
					oControl.$("triggerList").css("display", "none");
				} else {
					if (bLengthFinal) {
						oControl.$("triggerInfo").css("display", "block").text(this._getListItemInfo());
					}

					oTrigger.$().removeClass("sapMGrowingListBusyIndicatorVisible");
					oControl.$("triggerList").css("display", "");
				}

				// store the last item count to be able to focus to the newly added item when the growing button is pressed
				this._iLastItemsCount = this._oControl.getItems(true).length;

				// at the beginning we should scroll to last item
				if (bHasScrollToLoad && this._oScrollPosition === undefined && oControl.getGrowingDirection() == ListGrowingDirection.Upwards) {
					this._oScrollPosition = {
						left : 0,
						top : 0
					};
				}

				// scroll to last position
				if (iItemsLength > 0 && this._oScrollPosition) {
					var oScrollDelegate = this._oScrollDelegate,
						oScrollPosition = this._oScrollPosition;

					oScrollDelegate.scrollTo(oScrollPosition.left, oScrollDelegate.getScrollHeight() - oScrollPosition.top);
					this._oScrollPosition = null;
				}
			}
		}
778833
function(){
			var ls;
			
			if (lookingForNewDocument && FuncUnit.checkForNewDocument() ) {
				
				ls = loadSuccess;
				
				loadSuccess = null;
				if (ls) {
					FuncUnit.win.focus();
					FuncUnit.win.document.documentElement.tabIndex = 0;
					
					ls();
				}
			}
			
		setTimeout(arguments.callee, 500)
	}
590837
function (domEvt) {
            if (this._cfg.blurBeforeAction) {
                var document = Aria.$window.document;
                var activeElement = document.activeElement;
                this.getDom(); // makes sure _focusElt is defined
                if (activeElement && activeElement !== document.body && activeElement !== this._focusElt) {
                    activeElement.blur();
                    var self = this;
                    setTimeout(function () {
                        // executes the action a bit later, when the blur has been fully taken into account
                        // (especially by IE)
                        self._performAction(domEvt);
                    });
                    return true;
                }
            }
            return this.$ActionWidget._performAction.call(this, domEvt);
        }
1105642
def on_focusout(self, event, a):
		
		if event.widget.get() == '':
			event.widget.insert(0, default_text[a])
			event.widget.config(fg = 'grey')
787597
public void toggleFocus(boolean focusOn) {

        if (focusOn) {
            addStyleName(formCss().focused());
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_help) || m_hasError) {
                if (shouldDisplayTooltipAbove()) {
                    addStyleName(formCss().displayAbove());
                } else {
                    removeStyleName(formCss().displayAbove());
                }
            } else {
                m_helpBubble.getStyle().setDisplay(Display.NONE);
            }
        } else {
            removeStyleName(formCss().focused());
            if (m_widget != null) {
                if (m_handler.hasSingleOptionalValue()) {
                    if (m_handler.getWidgetService().shouldRemoveLastValueAfterUnfocus(m_widget)) {
                        m_handler.removeAttributeValue(this);
                    }

                }
            }
        }
    }
768367
def focusInEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(ShellWidget, self).focusInEvent(event)
793234
function (event) {
            this.$Widget._dom_onmouseleave.call(this, event);
            if (this._ellipsis && this._ellipsis.ellipsesNeeded) {
                if (this._hasFocus === false && this._hasMouseOver === true) {
                    this._hasMouseOver = false;
                    this._ellipsis._hideFullText(event.relatedTarget);
                }
            }
        }
1143255
def focusOutEvent(self, event):
        
        self.clicked_outside = True
        return super(QLineEdit, self).focusOutEvent(event)
1132014
function _notifyActiveEditorChanged(current) {
        // Skip if the Editor that gained focus was already the most recently focused editor.
        // This may happen e.g. if the window loses then regains focus.
        if (_lastFocusedEditor === current) {
            return;
        }
        var previous = _lastFocusedEditor;
        _lastFocusedEditor = current;

        exports.trigger("activeEditorChange", current, previous);
    }
662256
def focusInEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(PageControlWidget, self).focusInEvent(event)
536608
def focusInEvent(self, event):
        
        self.focused_in.emit(event)
        super(CodeEdit, self).focusInEvent(event)
1218919
function(parent) {
			var self = this;
			// We listen to focus lost and remember the last one with focus.  This is great for clicks away from dialog.
			this.$frame.addEventListener("blur", function(e) { //$NON-NLS-0$
				self.$lastFocusedElement = e.target;
			}, true);
			this._modalListener = function(e) { //$NON-NLS-0$
				var preventFocus =	!lib.contains(self.$frame, e.target);
				if (preventFocus) {
					for (var i = 0; i<self.$$modalExclusions.length; i++) {
						if (lib.contains(self.$$modalExclusions[i], e.target)) {
							preventFocus = false;
							break;
						}
					}
				}
				if (preventFocus) {
					window.setTimeout(function() {
						(self.$lastFocusedElement || self.$parent).focus();
					}, 0);
					lib.stop(e);
				}
			};
			this.$frameParent.addEventListener("focus", this._modalListener, true);  //$NON-NLS-0$
			this.$frameParent.addEventListener("click", this._modalListener, true);  //$NON-NLS-0$
			var children = this.$frameParent.childNodes;
			var exclude = false;
			this._addedBackdrop = [];
			for (var i=0; i<children.length; i++) {
				for (var j=0; j<this.$$modalExclusions.length; j++) {
					if (lib.contains(this.$$modalExclusions[j], children[i])) {
						exclude = true;
						break;
					}
				}
				if (!exclude && children[i] !== self.$frame && children[i].classList && !children[i].classList.contains("tooltipContainer")) { //$NON-NLS-0$
					var child = children[i];
					if (!child.classList.contains("modalBackdrop")) {  //$NON-NLS-0$
						child.classList.add("modalBackdrop"); //$NON-NLS-0$
						this._addedBackdrop.push(child);
					} 
				}
			}
			
			// When tabbing out of the dialog, using the above technique (restore to last focus) will put the focus on the last element, but
			// we want it on the first element, so let's prevent the user from tabbing out of the dialog.
			lib.trapTabs(this.$frame);
			this.$frame.setAttribute("aria-modal", "true");
		}
896820
function onListLeave () {
    if (!hasFocus && !ctrl.hidden) elements.input.focus();
    noBlur = false;
    ctrl.hidden = shouldHide();
  }
840729
def focusOutEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(PageControlWidget, self).focusOutEvent(event)
1309873
function (domElement, event, isParent) {
            var parent = (!isParent) ? domElement.parentNode : domElement;
            var domUtil = ariaUtilsDom;
            var label = parent.firstChild.textContent || parent.firstChild.innerText;
            domUtil.removeElement(parent);
            this._removeValue(label);
            if (event && event.type == "click") {
                this.getTextInputField().focus();

            }

        }
997299
function focus(editor) {
    setTimeout(function() {
      if (sourceMode(editor)) editor.$area.focus();
      else editor.$frame[0].contentWindow.focus();
      refreshButtons(editor);
    }, 0);
  }