本文整理了Java中org.eclipse.swt.widgets.Shell.setSavedFocus()
方法的一些代码示例,展示了Shell.setSavedFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.setSavedFocus()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:setSavedFocus
暂无
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void fixFocus (Control focusControl) {
Shell shell = getShell ();
Control control = this;
Display display = this.display;
boolean oldFixFocus = display.fixFocus;
display.fixFocus = true;
try {
while (control != shell && (control = control.parent) != null) {
if (control.setFocus ()) return;
}
} finally {
display.fixFocus = oldFixFocus;
}
shell.setSavedFocus (focusControl);
OS.SetFocus (0);
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
void fixFocus ( Control focusControl) {
Shell shell = getShell ();
Control control = this;
while (control != shell && (control = control.parent) != null) {
if (control.setFixedFocus ()) {
return;
}
}
shell.setSavedFocus (focusControl);
// OS.SetFocus (0);
// Replacement for OS.setFocus( 0 )
IDisplayAdapter displayAdapter = display.getAdapter( IDisplayAdapter.class );
displayAdapter.setFocusControl( null, true );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
shell.setSavedFocus( this );
if( !isEnabled() || !isVisible() || !isActive() ) {
return false;
return true;
shell.setSavedFocus( null );
setFocusControl( this ); // was: OS.SetFocus( handle );
if( isDisposed() ) {
return false;
shell.setSavedFocus( this );
return isFocusControl();
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void fixFocus (Control focusControl) {
Shell shell = getShell ();
Control control = this;
while (control != shell && (control = control.parent) != null) {
if (control.setFocus ()) return;
}
shell.setSavedFocus (focusControl);
NSWindow window = view.window();
if (!window.makeFirstResponder(null)) {
// Force first responder to resign.
window.endEditingFor(null);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void fixFocus (Control focusControl) {
Shell shell = getShell ();
Control control = this;
while (control != shell && (control = control.parent) != null) {
if (control.setFocus ()) return;
}
shell.setSavedFocus (focusControl);
int /*long*/ focusHandle = shell.vboxHandle;
OS.gtk_widget_set_can_focus (focusHandle, true);
OS.gtk_widget_grab_focus (focusHandle);
// widget could be disposed at this point
if (isDisposed ()) return;
OS.gtk_widget_set_can_focus (focusHandle, false);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void fixFocus (Control focusControl) {
Shell shell = getShell ();
Control control = this;
while (control != shell && (control = control.parent) != null) {
if (control.setFocus ()) return;
}
shell.setSavedFocus (focusControl);
int /*long*/ focusHandle = shell.vboxHandle;
OS.gtk_widget_set_can_focus (focusHandle, true);
OS.gtk_widget_grab_focus (focusHandle);
// widget could be disposed at this point
if (isDisposed ()) return;
OS.gtk_widget_set_can_focus (focusHandle, false);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
void fixFocus (Control focusControl) {
Shell shell = getShell ();
Control control = this;
while (control != shell && (control = control.parent) != null) {
if (control.setFocus ()) return;
}
shell.setSavedFocus (focusControl);
long /*int*/ focusHandle = shell.vboxHandle;
OS.gtk_widget_set_can_focus (focusHandle, true);
OS.gtk_widget_grab_focus (focusHandle);
// widget could be disposed at this point
if (isDisposed ()) return;
OS.gtk_widget_set_can_focus (focusHandle, false);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Forces the receiver to have the <em>keyboard focus</em>, causing
* all keyboard events to be delivered to it.
*
* @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see #setFocus
*/
public boolean forceFocus () {
checkWidget();
if (display.focusEvent == SWT.FocusOut) return false;
Shell shell = getShell ();
shell.setSavedFocus (this);
if (!isEnabled () || !isVisible ()) return false;
shell.bringToTop (false);
return forceFocus (focusHandle ());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Forces the receiver to have the <em>keyboard focus</em>, causing
* all keyboard events to be delivered to it.
*
* @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see #setFocus
*/
public boolean forceFocus () {
checkWidget();
if (display.focusEvent == SWT.FocusOut) return false;
Shell shell = getShell ();
shell.setSavedFocus (this);
if (!isEnabled () || !isVisible ()) return false;
shell.bringToTop (false);
return forceFocus (focusHandle ());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Forces the receiver to have the <em>keyboard focus</em>, causing
* all keyboard events to be delivered to it.
*
* @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @see #setFocus
*/
public boolean forceFocus () {
checkWidget();
if (display.focusEvent == SWT.FocusOut) return false;
Shell shell = getShell ();
shell.setSavedFocus (this);
if (!isEnabled () || !isVisible ()) return false;
shell.bringToTop (false);
return forceFocus (focusHandle ());
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
void releaseWidget() {
if( menu != null ) {
removeMenuDisposeListener();
menu.dispose();
menu = null;
}
Shell shell = internalGetShell();
if( display.getFocusControl() == this ) {
Control focusControl = parent;
while( focusControl != null && focusControl.isInDispose() ) {
focusControl = focusControl.getParent();
}
if( focusControl != null && focusControl.internalGetShell() != shell ) {
focusControl = null;
}
setFocusControl( focusControl );
}
if( shell.getSavedFocus() == this ) {
shell.setSavedFocus( null );
}
internalSetRedraw( false );
if( accessible != null ) {
accessible.internal_dispose_Accessible();
}
accessible = null;
super.releaseWidget();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
Control savedFocus = shell.savedFocus;
OS.SetParent (hwnd, 0);
shell.setSavedFocus (savedFocus);
if ((bits1 & OS.WS_VISIBLE) != 0) {
OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0);
内容来源于网络,如有侵权,请联系作者删除!