package com.redhat.ceylon.eclipse.code.navigator;

import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.viewers.Viewer;

public class NonEssentialEmptyPackageFilter extends NonEssentialElementsFilter {

	public NonEssentialEmptyPackageFilter() {
		super();
	}

	@Override
	protected boolean doSelect(Viewer viewer, Object parent, Object element) {
		if (element instanceof IPackageFragment) {
			IPackageFragment pkg= (IPackageFragment)element;
			try {
				return pkg.hasChildren() || hasUnfilteredResources(viewer, pkg);
			} catch (JavaModelException e) {
				return false;
			}
		}
		return true;
	}
}

@@ -545,16 +545,66 @@
 en() %7C%7C 
+%0A%09%09%09%09        pkg.hasSubpackages() %7C%7C %0A%09%09%09%09        
 hasUnfil

fix bug in filter for #1187