Bug 282875 [UI] Allow parts of models to be rendered
We need to change the rendering protocol to allow a 'createGui' to specify the container it should be created under (in SWT-land this would be a Composite). This is necessary to facilitate unit tests and to allow the ad-hoc rendering of chunks of a model within an arbitrary container (i.e. a Dialog or Wizard). In order to do this we'll have to make an API change to the PartFactory's 'createWidget' so that it will get the parent container as a parameter. In order to 'upgrade' an existing PartFactory you would simply replace the code you're currently using to find the correct container with the new parameter's value.
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/internal/Workbench.java
workbench = model;
		init();
	}
	
	
	public void setWorkbenchModelURI(URI workbenchXmiURI) {
		createWorkbenchModel(workbenchXmiURI);
	}
	public static IEclipseContext createWorkbenchContext(final IEclipseContext applicationContext,
			IExtensionRegistry registry, IExceptionHandler exceptionHandler,
			IContributionFactory contributionFactory) {
		Activator
				.trace(
						Policy.DEBUG_CONTEXTS,
						"createWorkbenchContext: initialize the workbench context with needed services", null); 
		final IEclipseContext mainContext = EclipseContextFactory.create(applicationContext,
				UISchedulerStrategy.getInstance());
		mainContext.set(Logger.class.getName(), ContextInjectionFactory.inject(
				new WorkbenchLogger(), mainContext));
		mainContext.set(IContextConstants.DEBUG_STRING, "WorkbenchContext"); 
		
		if (contributionFactory != null) {
			mainContext.set(IContributionFactory.class.getName(), contributionFactory);
		}
		mainContext.set(CommandManager.class.getName(), new CommandManager());
		mainContext.set(ContextManager.class.getName(), new ContextManager());
		mainContext.set(ECommandService.class.getName(), new ContextCommandService(mainContext));
		mainContext.set(IServiceConstants.ACTIVE_CONTEXTS, new ActiveContextsFunction());
		mainContext.set(IServiceConstants.ACTIVE_PART, new ActivePartLookupFunction());
		mainContext.runAndTrack(new Runnable() {