Bug 32656 Open/Close project in package explorer looses selection on java-projects. [package explorer]
Not on non-java projects, which looks wrong when multiple java- and non-java-projects are opened/closed.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java
Set containers= new HashSet(roots.length);
		for (int i= 0; i < roots.length; i++) {
			if (roots[i] instanceof IPackageFragmentRoot) {
				IPackageFragmentRoot root= (IPackageFragmentRoot)roots[i];
				IClasspathEntry entry= null;
				try {
					entry= root.getRawClasspathEntry();
				} catch (JavaModelException e) {
					continue;
				}
				if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) 
					containers.add(entry);
				else
					result.add(root);
			} else {
				result.add(roots[i]);
			}
		}
		for (Iterator each= containers.iterator(); each.hasNext();) {
			IClasspathEntry element= (IClasspathEntry) each.next();
			result.add(new ClassPathContainer(project, element));
		}		
		return result.toArray();
	}
	private Object[] getContainerPackageFragmentRoots(ClassPathContainer container) throws JavaModelException {
		return container.getPackageFragmentRoots();
	}
	private Object[] getNonJavaProjects(IJavaModel model) throws JavaModelException {
		return model.getNonJavaResources();
	}