Bug 15157 New-> menu disappears when folder is selected
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
if (size == 0 || (size == 1 && isNewTarget(jElement))) {
			MenuManager newMenu= new MenuManager(PackagesMessages.getString("PackageExplorer.new")); 
			menu.appendToGroup(IContextMenuConstants.GROUP_NEW, newMenu);
			new NewWizardMenu(newMenu, getSite().getWorkbenchWindow(), false);
		}
		if (size == 1)
			addOpenNewWindowAction(menu, element);
		fActionGroups.setContext(new ActionContext(selection));
		fActionGroups.fillContextMenu(menu);
		fActionGroups.setContext(null);
	}
	private boolean isNewTarget(IJavaElement element) {
		if (element == null)
			return false;
		int type= element.getElementType();
		return type == IJavaElement.JAVA_PROJECT ||
			type == IJavaElement.PACKAGE_FRAGMENT_ROOT || 
			type == IJavaElement.PACKAGE_FRAGMENT;
	}
	
	private void addOpenNewWindowAction(IMenuManager menu, Object element) {
		if (element instanceof IJavaElement) {
			try {
				element= ((IJavaElement)element).getCorrespondingResource();
			} catch(JavaModelException e) {
			}
		}
		if (!(element instanceof IContainer))
			return;