Bug 5264 Class detail filtering options in packages view.
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
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;
			}
		}
		return true;	
	}