display.ignoreFocus = false; Control newFocus = display.getFocusControl (); if (oldFocus != newFocus) { if (oldFocus != null && !oldFocus.isDisposed ()) oldFocus.sendFocusEvent (SWT.FocusOut, false); if (newFocus != null && !newFocus.isDisposed () && newFocus.isEnabled ()) newFocus.sendFocusEvent (SWT.FocusIn, false); }
public boolean forceFocus () {	checkWidget();	if (display.focusEvent == SWT.FocusOut) return false;	Decorations shell = menuShell ();	shell.setSavedFocus (this);	if (!isEnabled () || !isVisible ()/* || !isActive ()*/) return false;	if (isFocusControl ()) return true;	shell.setSavedFocus (null);	shell.bringToTop (false);	if (isDisposed ()) return false;	int focusHandle = focusHandle ();	int window = OS.GetControlOwner (focusHandle);	OS.SetKeyboardFocus (window, focusHandle, (short) OS.kControlFocusNextPart);	if (isDisposed ()) return false;	shell.setSavedFocus (this);	return hasFocus ();}