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
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.URIConverter;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
import org.eclipse.osgi.service.datalocation.Location;
import org.osgi.framework.Bundle;
import org.osgi.service.packageadmin.PackageAdmin;
public class Workbench implements IWorkbench {
	public static final String LOCAL_ACTIVE_SHELL = "localActiveShell"; 
	public static final String ID = "org.eclipse.e4.workbench.fakedWBWindow"; 
	private MApplication<? extends MWindow> workbench;
	private static final boolean saveAndRestore = true;
	private File workbenchData;
	private IWorkbenchWindowHandler windowHandler;
	private final IExtensionRegistry registry;
	private ResourceSetImpl resourceSet;
	public IEclipseContext getContext() {
		return workbenchContext;
	}
	
	private PartRenderer renderer;
	private int rv;
	private ExceptionHandler exceptionHandler;
	private IEclipseContext workbenchContext;
	private ReflectionContributionFactory contributionFactory;
	public Workbench(Location instanceLocation, IExtensionRegistry registry,