Bug 310199 Need logic to grant focus to parts when their tab item has been selected
Build Id: I20100421-2055 I'm not sure why, but I noticed that in e4 on the macosx-cocoa, selecting an element often causes a blue focus halo to appear. It's a bit ugly.
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
if (selectedElement instanceof MContext) {
				return ((MContext) selectedElement).getContext();
			} else if (selectedElement instanceof MElementContainer<?>) {
				return getSubContext((MUIElement) selectedElement);
			}
		}
		return null;
	}
	private void internalFixContext(MPart part, MUIElement oldSelectedElement) {
		if (oldSelectedElement == null) {
			return;
		}
		MContext parentPart = getParentWithContext(oldSelectedElement);
		if (parentPart == null) {
			
			return;
		}
		IEclipseContext parentContext = parentPart.getContext();
		IEclipseContext oldContext = getSubContext(oldSelectedElement);
		Object child = parentContext.get(IContextConstants.ACTIVE_CHILD);
		if (child == null || oldContext == null || child == oldContext) {
			parentContext.set(IContextConstants.ACTIVE_CHILD,
					part == null ? null : part.getContext());
		}
	}
	public MPart findPart(String id) {
		MApplicationElement element = modelService.find(id, rootContainer);
		if (element instanceof MPlaceholder) {
			((MPlaceholder) element).getRef().setCurSharedRef((MPlaceholder) element);
			element = ((MPlaceholder) element).getRef();