Bug 48968 "Focus on" in typehierarchy doesn't show name for anonymous inners [type hiearchy]
I2003-12-16-20:00 1) Import Junit 2) Create a Java working set containing junit.framework 3) open a type hierarchy on junit.framework.Protectable. 4) In the type hierarchy, select the working set created in step 2). 5) Observe: Protectable has an anonymous inner subclass 6) open the context menu on the anonymous class 7) observe: the menu contains an entry like this: "Focus on ''". I.e. there is no label for the anonymous inner class.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/FocusOnSelectionAction.java
}
	
	private ISelection getSelection() {
		ISelectionProvider provider= fViewPart.getSite().getSelectionProvider();
		if (provider != null) {
			return provider.getSelection();
		}
		return null;
	}
	
	/*
	 * @see Action#run
	 */
	public void run() {
		Object element= SelectionUtil.getSingleElement(getSelection());
		if (element instanceof IType) {
			fViewPart.setInputElement((IType)element);
		}
	}	
	
	public boolean canActionBeAdded() {
		Object element= SelectionUtil.getSingleElement(getSelection());
		if (element instanceof IType) {
			setText(TypeHierarchyMessages.getFormattedString("FocusOnSelectionAction.label", ((IType)element).getElementName())); 
			return true;
		}
		return false;
	}
}