IPackageFragment p1= (IPackageFragment)e1; IPackageFragment p2= (IPackageFragment)e2;
	public int compare(Viewer v, Object e1, Object e2) {		// show resources after Java elements		// we have to handle both IStorage and IResource separetly...		IResource r1= null;		IResource r2= null;		if (e1 instanceof IResource)			r1= (IResource)e1;		if (e2 instanceof IResource)			r2= (IResource)e2;		if (r1 != null && r2 != null)			return r1.getName().compareToIgnoreCase(r2.getName());		if (r1 != null && r2 == null)			return 1;		if (r1 == null && r2 != null)			return -1;			IStorage s1= null;		IStorage s2= null;		if (e1 instanceof IStorage)			s1= (IStorage)e1;		if (e2 instanceof IStorage)			s2= (IStorage)e2;		if (s1 != null && s2 != null)			return s1.getName().compareToIgnoreCase(s2.getName());		if (s1 != null && s2 == null)			return 1;		if (s1 == null && s2 != null)			return -1;		if (fIsClassPathSortOrder) {			int p1= classPathIndex((IJavaElement)e1);			int p2= classPathIndex((IJavaElement)e2);			if (p1 < p2)				return -1;			if (p1 > p2)				return 1;		}						if (e1 instanceof IPackageFragment) {			// compare between non-java package fragment and java package fragment			IPackageFragment p1= (IPackageFragment)e1;			IPackageFragment p2= (IPackageFragment)e2;			try {				boolean isFolder1= isFolder(p1);				boolean isFolder2= isFolder(p2);				if (isFolder1 && !isFolder2) 					return 1;				if (!isFolder1 && isFolder2)					return -1;			} catch(JavaModelException e) {			}		}					String name1= ((IJavaElement)e1).getElementName();		String name2= ((IJavaElement)e2).getElementName();		return name1.compareToIgnoreCase(name2);	}