Bug 45187 Double clicking in Package Explorer highlights class name [package explorer]
Rurn on "Show members in Package Explorer" Using EclipsePlugin as an example class name, when double clicking on a method in that class, like getDefault, getDefault is selected in the editor, but the highlight in the package explorer jumps to EclipsePlugin instead of remaining on getDefault. This is the behavior if "Link with editor" is turned on. If it is turned off, the highlight doesn't jump.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
else if (element instanceof IResource)
			return ((IResource)element).getParent();
			
		return null;
	}
	
	/**
	 * A compilation unit or class was expanded, expand
	 * the main type.  
	 */
	void expandMainType(Object element) {
		try {
			IType type= null;
			if (element instanceof ICompilationUnit) {
				ICompilationUnit cu= (ICompilationUnit)element;
				IType[] types= cu.getTypes();
				if (types.length > 0)
					type= types[0];
			}
			else if (element instanceof IClassFile) {
				IClassFile cf= (IClassFile)element;
				type= cf.getType();
			}			
			if (type != null) {
				final IType type2= type;
				Control ctrl= fViewer.getControl();
				if (ctrl != null && !ctrl.isDisposed()) {
					ctrl.getDisplay().asyncExec(new Runnable() {
						public void run() {
							Control ctrl2= fViewer.getControl();