Bug 5475 F4 causes loss of context when called from a method view
1) Open a class with many methods 2) Make sure "show of source element only" is selected 3) Choose a method 4) Press F4 with no selection The class is open on the hierarchy view and the full source is shown in the editor. The method focus was lost. You have to find and select the method again.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
public void selectionChanged(SelectionChangedEvent event) {
				typeSelectionChanged(event.getSelection());
			}
		};
		
		KeyListener keyListener= createKeyListener();
		
		HierarchyLabelProvider lprovider= new HierarchyLabelProvider(this, new MarkerErrorTickProvider());
				
		
		TypeHierarchyViewer superTypesViewer= new SuperTypeHierarchyViewer(fViewerbook, fHierarchyLifeCycle, lprovider, this);
		initializeTypesViewer(superTypesViewer, selectionChangedListener, keyListener, IContextMenuConstants.TARGET_ID_SUPERTYPES_VIEW);
		
		TypeHierarchyViewer subTypesViewer= new SubTypeHierarchyViewer(fViewerbook, fHierarchyLifeCycle, lprovider, this);
		initializeTypesViewer(subTypesViewer, selectionChangedListener, keyListener, IContextMenuConstants.TARGET_ID_SUBTYPES_VIEW);
		
		TypeHierarchyViewer vajViewer= new TraditionalHierarchyViewer(fViewerbook, fHierarchyLifeCycle, lprovider, this);
		initializeTypesViewer(vajViewer, selectionChangedListener, keyListener, IContextMenuConstants.TARGET_ID_HIERARCHY_VIEW);
		fAllViewers= new TypeHierarchyViewer[3];
		fAllViewers[VIEW_ID_SUPER]= superTypesViewer;
		fAllViewers[VIEW_ID_SUB]= subTypesViewer;
		fAllViewers[VIEW_ID_TYPE]= vajViewer;
		
		int currViewerIndex;
		try {
			currViewerIndex= fDialogSettings.getInt(DIALOGSTORE_HIERARCHYVIEW);
			if (currViewerIndex < 0 || currViewerIndex > 2) {
				currViewerIndex= VIEW_ID_TYPE;
			}
		} catch (NumberFormatException e) {