Bug 33216 Source actions in context menu on types inconsistency
1) select a type in the package explorer 2) bring up the context menu ->the source actions are shown in-line and the menu is huge. Given that we show a source submenu in other parts (e.g. the editor) and do the same for the refactoring actions we should also move the source actions into a submenu.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
}
	
	private boolean internalIsAncestorOf(IJavaElement ancestor, IJavaElement element) {
		if (element != null)
			return element.equals(ancestor) || internalIsAncestorOf(ancestor, element.getParent());
		else
			return false;
	}
	private boolean isSearchResultView(IWorkbenchPart part) {
		return SearchUtil.isSearchPlugInActivated() && (part instanceof ISearchResultView);
	}
	protected boolean needsToProcessSelectionChanged(IWorkbenchPart part, ISelection selection) {
		if (!fProcessSelectionEvents || part == this || isSearchResultView(part) || !(selection instanceof IStructuredSelection)){
			if (part == this)
				fPreviousSelectionProvider= part;
			return false;
		}
		return true;
	}
	
	public void selectionChanged(IWorkbenchPart part, ISelection selection) {
		if (!needsToProcessSelectionChanged(part, selection))
			return;
		
		
		Object selectedElement= getSingleElementFromSelection(selection);
		
		if (selectedElement != null && (part == null || part.equals(fPreviousSelectionProvider)) && selectedElement.equals(fPreviousSelectedElement))
			return;
		fPreviousSelectedElement= selectedElement;