本文整理匯總了Java中org.eclipse.swt.widgets.Shell.forceActive方法的典型用法代碼示例。如果您正苦於以下問題:Java Shell.forceActive方法的具體用法?Java Shell.forceActive怎麽用?Java Shell.forceActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Shell
的用法示例。
在下文中一共展示了Shell.forceActive方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: launch
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
* Launch SwtAppleCommander with a given display.
* Primary motivation is getting S-Leak to work!
*/
public void launch(Display display) {
imageManager = new ImageManager(display);
SwtAppleCommander application = new SwtAppleCommander();
Shell shell = application.open(display);
shell.forceActive();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
UserPreferences.getInstance().save();
}
示例2: open
import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
public void open() {
UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (uiFunctions != null) {
Boolean bringToFront = (Boolean)getData( "bringToFront" );
if ( bringToFront == null || bringToFront ){
Shell mainShell = uiFunctions.getMainShell();
if (mainShell != null && mainShell.getMinimized()) {
uiFunctions.bringToFront();
}
}
}
Shell firstShellWithStyle = Utils.findFirstShellWithStyle(SWT.APPLICATION_MODAL);
if (firstShellWithStyle != null && firstShellWithStyle != this) {
// ok, there's a window with application_modal set, which on OSX will mean
// that if we open our window, it will be on top, but users won't be able
// to interact with it. So, wait until the modal window goes away..
firstShellWithStyle.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
// wait for dispose to complete, then run open again to check for
// any new application modal shells to wait for
Utils.execSWTThreadLater(0, new AERunnable() {
@Override
public void runSupport() {
AEShell.this.open();
}
});
}
});
firstShellWithStyle.setVisible(true);
firstShellWithStyle.forceActive();
} else {
if (!isDisposed()) {
super.open();
}
}
}