Bug 304584 [Tooling] Implement Workbench-Model-Tooling
As the title describes we should provide users an easy to use Model-Editor.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/ResourceHandlerTest.java
IEclipseContext localContext = applicationContext.createChild();
		localContext.set(E4Workbench.INSTANCE_LOCATION, getInstanceLocation());
		localContext.set(E4Workbench.PERSIST_STATE, Boolean.TRUE);
		localContext.set(E4Workbench.CLEAR_PERSISTED_STATE, Boolean.TRUE);
		localContext.set(E4Workbench.DELTA_RESTORE, Boolean.TRUE);
		localContext.set(E4Workbench.INITIAL_WORKBENCH_MODEL_URI, uri);
		return ContextInjectionFactory
				.make(ResourceHandler.class, localContext);
	}
	public void testLoadMostRecent() {
		URI uri = URI.createPlatformPluginURI(
				"org.eclipse.e4.ui.tests/xmi/InvalidContainment.e4xmi", true);
		ResourceHandler handler = createHandler(uri);
		Resource resource = handler.loadMostRecentModel();
		assertNotNull(resource);
		assertEquals(E4XMIResource.class, resource.getClass());
		checkData(resource);
	}
	public void testLoadBaseModel() {
		URI uri = URI.createPlatformPluginURI(
				"org.eclipse.e4.ui.tests/xmi/InvalidContainment.e4xmi", true);
		ResourceHandler handler = createHandler(uri);
		Resource resource = handler.loadBaseModel();
		assertNotNull(resource);
		assertEquals(E4XMIResource.class, resource.getClass());
		checkData(resource);
	}
	private void checkData(Resource resource) {
		assertNotNull(resource);
		assertEquals(1, resource.getContents().size());