當前位置: 首頁>>代碼示例>>Java>>正文


Java Shell.forceActive方法代碼示例

本文整理匯總了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();
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:17,代碼來源:SwtAppleCommander.java

示例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();
		}
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:40,代碼來源:ShellFactory.java


注:本文中的org.eclipse.swt.widgets.Shell.forceActive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。