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.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/ContributedPartFactory.java
final MContributedPart<?> contributedPart = (MContributedPart<?>) part;
			final IHandlerService hs = new PartHandlerService(part);
			final IEclipseContext localContext = EclipseContextFactory.create(
					parentContext, UIContextScheduler.instance);
			localContext.set(IContextConstants.DEBUG_STRING, "ContributedPart"); 
			final IEclipseContext outputContext = EclipseContextFactory.create(
					null, UIContextScheduler.instance);
			outputContext.set(IContextConstants.DEBUG_STRING,
					"ContributedPart-output"); 
			contributedPart.setContext(localContext);
			localContext.set(Composite.class.getName(), newComposite);
			localContext.set(IHandlerService.class.getName(), hs);
			localContext.set(IServiceConstants.OUTPUTS, outputContext);
			localContext.set(IEclipseContext.class.getName(), outputContext);
			localContext.set(MContributedPart.class.getName(), contributedPart);
			localContext.set(IServiceConstants.PERSISTED_STATE, contributedPart
					.getPersistedState());
			outputContext.runAndTrack(new Runnable() {
				public void run() {
					Object state = outputContext
							.get(IServiceConstants.PERSISTED_STATE);
					if (state != null) {
						contributedPart.setPersistedState((String) state);
					}
				}
			}, ""); 
			parentContext.set(IServiceConstants.ACTIVE_CHILD, localContext);
			Object newPart = contributionFactory.create(contributedPart
					.getURI(), localContext);
			contributedPart.setObject(newPart);