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/StackModelFactory.java
public Object createWidget(MPart<?> part) {
		Widget newWidget = null;
		if (!(part instanceof MStack))
			return null;
		Widget parentWidget = getParentWidget(part);
		if (parentWidget instanceof Composite) {
			IEclipseContext parentContext = getContextForParent(part);
			
			
			boolean showCloseAlways = false;
			boolean showMinMax = false;
			int styleModifier = 0;
			if (part.getPolicy() != null && part.getPolicy().length() > 0) {
				String policy = part.getPolicy();
				if (policy.indexOf("ViewStack") >= 0) { 
					styleModifier = SWT.CLOSE;
					showMinMax = true;
				}
				if (policy.indexOf("EditorStack") >= 0) { 
					styleModifier = SWT.CLOSE;
					showCloseAlways = true;
					showMinMax = true;
				}
			}
			final CTabFolder ctf = new CTabFolder((Composite) parentWidget,
					SWT.BORDER | styleModifier);
			ctf.setUnselectedCloseVisible(showCloseAlways);
			ctf.setMaximizeVisible(showMinMax);
			ctf.setMinimizeVisible(showMinMax);
			bindWidget(part, ctf);