Bug 11748 switch to new DecoratorManager API
From the workbench change notes: API changes IWorkbenchPartSite.getDecoratorManager() - As the DecoratorManager has proven to be required for more than just IWorkbenchPartSites we have moved getDecoratorManager() to IWorkbench and deprecated the getDecoratorManager() in IWorkbenchPartSite. The one in IWorkbenchPartSite will be removed after the other Eclipse components have had a chance to switch to the new API.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
IAdaptable element= (IAdaptable)selection.getFirstElement();
		Object resource= element.getAdapter(IResource.class);
		if (!(resource instanceof IFile))
			return; 
		
		MenuManager submenu= new MenuManager(PackagesMessages.getString("PackageExplorer.openWith")); 
		submenu.add(new OpenWithMenu(getSite().getPage(), (IFile) resource));
		
		menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
	}
	
	private boolean isSelectionOfType(ISelection s, Class clazz, boolean considerUnderlyingResource) {
		if (! (s instanceof IStructuredSelection) || s.isEmpty())
			return false;
		
		IStructuredSelection selection= (IStructuredSelection)s;
		Iterator iter= selection.iterator();
		while (iter.hasNext()) {
			Object o= iter.next();
			if (clazz.isInstance(o))
				return true;
			if (considerUnderlyingResource) {
				if (! (o instanceof IJavaElement))
					return false;
				IJavaElement element= (IJavaElement)o;
				Object resource= element.getAdapter(IResource.class);
				if (! clazz.isInstance(resource))
					return false;
			}
		}