当前位置: 首页>>代码示例>>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;未经允许,请勿转载。