Bug 24271 Source Folders: Sort Java Packages and Simple Folders Together
In Eclipse 1.0, packages and simple folders were not sorted together within the Project (as the source folder). Packages were (sorted) and placed first, followed by simple folders (that were also sorted). In Eclipse 2.0, the packages and simple folders are sorted together within the Project (as the source folder). Unfortunately, if you use Source Folders the packages and source folders are sorted as described above in Eclipse 1.0. It would be useful for packages and simple folders to be sorted together within their Source Folder.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementSorter.java
}
		}
		
		if (cat1 == RESOURCES || cat1 == RESOURCEFOLDERS || cat1 == STORAGE || cat1 == OTHERS) {
			return compareWithLabelProvider(viewer, e1, e2);
		}
		
		String name1= ((IJavaElement) e1).getElementName();
		String name2= ((IJavaElement) e2).getElementName();
		
		
		int cmp= getCollator().compare(name1, name2);
		if (cmp != 0) {
			return cmp;
		}
		
		if (e1 instanceof IMethod) {
			String[] params1= ((IMethod) e1).getParameterTypes();
			String[] params2= ((IMethod) e2).getParameterTypes();
			int len= Math.min(params1.length, params2.length);
			for (int i = 0; i < len; i++) {
				cmp= getCollator().compare(Signature.toString(params1[i]), Signature.toString(params2[i]));
				if (cmp != 0) {
					return cmp;
				}
			}
			return params1.length - params2.length;
		}
		return 0;
	}