Bug 270989 Context refactoring
Based on discussions over the past weeks, I'm doing a refactoring of the context API. Major changes: - Renamed IComputedValue to IContextFunction - Renamed *Value to *Function - Renamed UIContextScheduler to UISchedulerStrategy - Added concept of ILookupStrategy to delegate lookup of keys that are not yet defined in a given context - Re-implemented OSGi service support using lookup strategy I also fixed a couple of NPE's I found while testing with the e4 photo demo (null realms, etc)
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/internal/Workbench.java
init(workbench);
		return workbench;
	}
	private MApplication<? extends MWindow> loadDefaultModel(
			URI defaultModelPath) {
		Resource resource = new ResourceSetImpl().getResource(defaultModelPath,
				true);
		MApplication<MWindow> app = (MApplication<MWindow>) resource
				.getContents().get(0);
		processPartContributions(resource, app.getWindows().get(0));
		return app;
	}
	private void processPartContributions(Resource resource, MWindow mWindow) {
		IExtensionRegistry registry = RegistryFactory.getRegistry();
		String extId = "org.eclipse.e4.workbench.parts"; 
		IConfigurationElement[] parts = registry
				.getConfigurationElementsFor(extId);
		for (int i = 0; i < parts.length; i++) {
			MContributedPart<?> part = ApplicationFactory.eINSTANCE
					.createMContributedPart();
			part.setName(parts[i].getAttribute("label")); 
			part.setIconURI("platform:/plugin/" 
					+ parts[i].getContributor().getName() + "/" 
					+ parts[i].getAttribute("icon")); 
			part.setURI("platform:/plugin/" 
					+ parts[i].getContributor().getName() + "/" 
					+ parts[i].getAttribute("class")); 
			String parentId = parts[i].getAttribute("parentId"); 
			MPart parent = (MPart) findObject(resource.getAllContents(),
					parentId);