當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。