当前位置: 首页>>代码示例>>Java>>正文


Java IWorkbenchWindow.getShell方法代码示例

本文整理汇总了Java中org.eclipse.ui.IWorkbenchWindow.getShell方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchWindow.getShell方法的具体用法?Java IWorkbenchWindow.getShell怎么用?Java IWorkbenchWindow.getShell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.IWorkbenchWindow的用法示例。


在下文中一共展示了IWorkbenchWindow.getShell方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
/**
 * the command has been executed, so extract extract the needed information
 * from the application context.
 */
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil
			.getActiveWorkbenchWindowChecked(event);
	final Display display = Display.getDefault();
	final Shell shell = window.getShell();
	Locale.setDefault(Locale.ENGLISH);
	final TipDayEx tipDayEx = new TipDayEx();
	for (String tipMessage : new String[] { "This is the first tip",
			"This is the second tip", "This is the third tip",
			"This is the forth tip", "This is the fifth tip" }) {
		tipDayEx.addTip(String.format(
				"<h4>%s</h4>" + "<b>%s</b> " + "<u>%s</u> " + "<i>%s</i> " + "%s "
						+ "%s<br/>" + "<p color=\"#A00000\">%s</p>",
				tipMessage, tipMessage, tipMessage, tipMessage, tipMessage,
				tipMessage, tipMessage));

	}
	tipDayEx.open(shell, display);
	return null;
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:25,代码来源:SampleHandler.java

示例2: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException {

		final INewWizard wizard = new NewModelWizard();

		// Initialize the selection
		final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
		final ISelectionService service = window.getSelectionService();
		final IStructuredSelection selection = (IStructuredSelection)service
				.getSelection("org.eclipse.sirius.ui.tools.views.model.explorer"); //$NON-NLS-1$
		wizard.init(PlatformUI.getWorkbench(), selection);

		// Open the new model wizard
		final WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
		dialog.open();
		return null;
	}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:17,代码来源:NewTime4SysModel.java

示例3: getActiveWorkbenchWindowShell

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
/**
 * Returns the active workbench window shell.
 * @return the active workbench window shell
 */
public Shell getActiveWorkbenchWindowShell() {
	IWorkbenchWindow iwbWindow = this.getActiveWorkbenchWindow();
	if (iwbWindow!=null) {
		return iwbWindow.getShell();
	}
	return null;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:12,代码来源:UiBridge.java

示例4: getActiveWorkbenchShell

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
/**
 * Returns active workbench shell - or <code>null</code>
 * 
 * @return active workbench shell - or <code>null</code>
 */
public static Shell getActiveWorkbenchShell() {
	IWorkbench workbench = getWorkbench();
	if (workbench == null) {
		return null;
	}
	IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
	if (window == null) {
		return null;
	}
	Shell shell = window.getShell();
	return shell;
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:18,代码来源:EclipseUtil.java

示例5: windowOpened

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public void windowOpened(IWorkbenchWindow window) {
	if (window.getShell() != null) {
		IWorkbenchPage[] pages = window.getPages();
		for (IWorkbenchPage page : pages) {
			pageOpened(page);
		}
		window.addPageListener(this);
	}
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:11,代码来源:EditorTracker.java

示例6: resetWorkbench

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
private void resetWorkbench() {
	try {
		IViewReference[] views = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences();
		for (IViewReference iViewReference : views) {
			 if ( iViewReference.getTitle().equals( "Welcome" ) ) {
				 	iViewReference.getPage().hideView(iViewReference);
					break;
			}
		}
		
		IWorkbench workbench = PlatformUI.getWorkbench();
		IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
		IWorkbenchPage page = workbenchWindow.getActivePage();
		Shell activeShell = Display.getCurrent().getActiveShell();
		if ( activeShell != null && activeShell != workbenchWindow.getShell() ) {
			activeShell.close();
		}
		page.closeAllEditors( false );
		page.resetPerspective();
		String defaultPerspectiveId = workbench.getPerspectiveRegistry().getDefaultPerspective();
		workbench.showPerspective( defaultPerspectiveId, workbenchWindow );
		page.resetPerspective();
	}
	catch ( WorkbenchException e ) {
		throw new RuntimeException( e );
	}

}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:29,代码来源:FilterTests.java

示例7: resetWorkbench

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
private static void resetWorkbench() {
	try {
		IViewReference[] views = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
				.getViewReferences();
		for (IViewReference iViewReference : views) {

			if (iViewReference.getTitle().equals("Welcome")) {
				iViewReference.getPage().hideView(iViewReference);
				break;
			}
		}

		IWorkbench workbench = PlatformUI.getWorkbench();
		IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
		IWorkbenchPage page = workbenchWindow.getActivePage();
		Shell activeShell = Display.getCurrent().getActiveShell();
		if (activeShell != null && activeShell != workbenchWindow.getShell()) {
			activeShell.close();
		}
		page.closeAllEditors(false);

	 	page.resetPerspective();
	 	String defaultPerspectiveId = workbench.getPerspectiveRegistry().getDefaultPerspective();
	 	workbench.showPerspective(defaultPerspectiveId, workbenchWindow);
	 	page.resetPerspective();
	} catch (WorkbenchException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:30,代码来源:WorkbenchHelper.java

示例8: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
	TargetHandlerDialog targetHandler = new TargetHandlerDialog(window.getShell());
	targetHandler.open();
	return null;
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:9,代码来源:LinkTargetProject.java

示例9: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
	ISelection selection = HandlerUtil.getCurrentSelection(event);
	POJO2DataTypeWizard wizard = new POJO2DataTypeWizard();
	wizard.init(window.getWorkbench(), 
			selection instanceof IStructuredSelection
			? (IStructuredSelection) selection : StructuredSelection.EMPTY);
	WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
	dialog.open();
	return null;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:13,代码来源:POJO2DataTypeHandler.java


注:本文中的org.eclipse.ui.IWorkbenchWindow.getShell方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。