Bug 330864 Add ability to find context for a UI element
bundles/org.eclipse.e4.core.contexts.debug/src/org/eclipse/e4/core/internal/contexts/debug/ui/ContextTreeProvider.java
if (!(element instanceof WeakReference<?>))
			return false;
		@SuppressWarnings("unchecked")
		WeakReference<EclipseContext> ref = (WeakReference<EclipseContext>) element;
		EclipseContext parentContext = ref.get();
		if (parentContext == null)
			return false;
		return (parentContext.getChildren() != null);
	}
	synchronized public void notify(EclipseContext context, IEclipseContextDebugger.EventType type, Object data) {
		switch (type) {
			case CONSTRUCTED :
				AllocationRecorder.getDefault().allocated(context, new Exception());
				EclipseContext newRoot = getRoot(context);
				boolean found = false;
				for (Iterator<WeakReference<EclipseContext>> i = activeContexts.iterator(); i.hasNext();) {
					WeakReference<EclipseContext> ref = i.next();
					EclipseContext storedRoot = ref.get();
					if (storedRoot == null) {
						i.remove();
						continue;
					}
					if (storedRoot == newRoot) {
						found = true;
						break;
					}
				}
				if (!found)
					activeContexts.add(new WeakReference<EclipseContext>(context));
				if (view != null && refreshJob != null)