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
public void run() {
				Object o = mainContext.get(IServiceConstants.ACTIVE_PART);
				if (o instanceof MContributedPart<?>) {
					mainContext.set(IServiceConstants.ACTIVE_PART_ID, ((MContributedPart<?>) o)
							.getId());
				}
			}
			/*
			 * For debugging purposes only
			 */
			@Override
			public String toString() {
				return IServiceConstants.ACTIVE_PART_ID;
			}
		});
		
		
		mainContext.set(IExceptionHandler.class.getName(), exceptionHandler);
		mainContext.set(IExtensionRegistry.class.getName(), registry);
		mainContext.set(IServiceConstants.SELECTION, new ActiveChildOutputFunction(
				IServiceConstants.SELECTION));
		mainContext.set(IServiceConstants.INPUT, new ContextFunction() {
			public Object compute(IEclipseContext context, Object[] arguments) {
				Class adapterType = null;
				if (arguments.length > 0 && arguments[0] instanceof Class) {
					adapterType = (Class) arguments[0];
				}
				Object newInput = null;
				Object newValue = mainContext.get(IServiceConstants.SELECTION);
				if (adapterType == null || adapterType.isInstance(newValue)) {