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)
examples/org.eclipse.e4.demo.e4photo/src/org/eclipse/e4/demo/e4photo/Library.java
public void selectionChanged(SelectionChangedEvent event) {
				StructuredSelection selection = (StructuredSelection)event.getSelection();
				outputContext.set(IServiceConstants.SELECTION, selection.size() == 1 ? selection.getFirstElement() : selection.toArray());
			}
		});
		IObservableFactory setFactory = new IObservableFactory() {
			public IObservable createObservable(Object element) {
				if (element instanceof IContainer && ((IContainer)element).exists()) {
					IObservableSet observableSet = observableSets.get(element);
					if (observableSet == null) {
						observableSet = new WritableSet(realm);
						try {
							observableSet.addAll(Arrays
									.asList(((IContainer) element).members()));
						} catch (CoreException e) {
							
							e.printStackTrace();
						}
						observableSets.put((IContainer) element, observableSet);
					}
					return observableSet;
				}
				return Observables.emptyObservableSet();
			}
		};
		viewer.setContentProvider(new ObservableSetTreeContentProvider(
				setFactory, new TreeStructureAdvisor() {
					public Boolean hasChildren(Object element) {
						return Boolean.valueOf(element instanceof IContainer);
					}