本文整理了Java中org.eclipse.swt.widgets.Button.forceFocus()
方法的一些代码示例,展示了Button.forceFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.forceFocus()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:forceFocus
暂无
代码示例来源:origin: inspectIT/inspectIT
select.forceFocus();
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private void createButtons() {
Composite composite = new Composite( shell, SWT.NONE );
composite.setLayout( new GridLayout( 0, true ) );
GridData gridData = new GridData( SWT.RIGHT, SWT.CENTER, true, false );
composite.setLayoutData( gridData );
Button okButton = createButton( composite, SWT.getMessage( "SWT_OK" ), SWT.OK );
shell.setDefaultButton( okButton );
createButton( composite, SWT.getMessage( "SWT_Cancel" ), SWT.CANCEL );
okButton.forceFocus();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private void createButtonArea( Composite parent ) {
Composite composite = new Composite( parent, SWT.NONE );
GridData layoutData = new GridData( SWT.RIGHT, SWT.CENTER, false, false, 2, 1 );
composite.setLayoutData( layoutData );
GridLayout layout = new GridLayout( 2, true );
layout.marginWidth = 0;
layout.marginHeight = 0;
composite.setLayout( layout );
Button okButton = createButton( composite, SWT.getMessage( "SWT_OK" ), SWT.OK );
okButton.getShell().setDefaultButton( okButton );
okButton.forceFocus();
createButton( composite, SWT.getMessage( "SWT_Cancel" ), SWT.CANCEL );
}
代码示例来源:origin: openaudible/openaudible
/**
* @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
*/
@Override
protected void initializeBounds() {
super.initializeBounds();
Point bestSize = getShell().computeSize(convertHorizontalDLUsToPixels(dialogMinWidth),
SWT.DEFAULT);
/** The URL Label might need more space than 300 DLUs */
int bestSizeWidth = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
if (bestSizeWidth > bestSize.x)
bestSize.x = bestSizeWidth;
Shell shell = getShell();
getShell().setSize(bestSize.x, bestSize.y);
LayoutShop.positionShell(getShell());
Button ok = getButton(0);
if (userString.length() == 0)
user.forceFocus();
else if (passwordString.length() == 0)
password.forceFocus();
else
ok.forceFocus();
}
内容来源于网络,如有侵权,请联系作者删除!