Bug 263544 [context] Add dependency injection context -> user object
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/internal/Workbench.java
} catch (CoreException e) {
				
				e.printStackTrace();
			}
		}
		mainContext.set(IWorkbench.class.getName(), this);
		mainContext.set(IExceptionHandler.class.getName(), exceptionHandler);
		mainContext.set(ResourceUtility.class.getName(), resourceUtility);
		mainContext.set(IExtensionRegistry.class.getName(), registry);
		return mainContext;
	}
	private MApplication<MWorkbenchWindow> createWorkbenchModel(
			String restoreFile, URI workbenchDefinitionInstance) {
		boolean restore = false;
		URI uri = null;
		Resource resource = null;
		if (!restore) {
			resource = new XMIResourceImpl();
			workbench = ApplicationFactory.eINSTANCE.createMApplication();
			resource.getContents().add((EObject) workbench);
			
			String initialPerspectiveId = "org.eclipse.e4.ui.workbench.fragment.testPerspective"; 
			populateWBModel(workbench, workbenchDefinitionInstance,
					initialPerspectiveId);
		} else {
			uri = URI.createFileURI(restoreFile);
			try {
				resource = new ResourceSetImpl().getResource(uri, true);
				workbench = (MApplication<MWorkbenchWindow>) resource
						.getContents().get(0);