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
}
	
	/**
	 * @deprecated Bug 22518. Method never used: does not override ViewerSorter#isSorterProperty(Object, String).
	 * Method could be removed, but kept for API compatibility.
	 */	
	public boolean isSorterProperty(Object element, Object property) {
		return true;
	}
	/*
	 * @see ViewerSorter#category
	 */
	public int category(Object element) {
		if (element instanceof IJavaElement) {
			try {
				IJavaElement je= (IJavaElement) element;
				switch (je.getElementType()) {
					case IJavaElement.METHOD: {
							IMethod method= (IMethod) je;
							if (method.isConstructor()) {
								return MEMBERSOFFSET + MembersOrderPreferencePage.getConstructorOffset();
							}
							int flags= method.getFlags();
							return MEMBERSOFFSET + MembersOrderPreferencePage.getMethodOffset(Flags.isStatic(flags));
						}
					case IJavaElement.FIELD: {
							int flags= ((IField) je).getFlags();
							return MEMBERSOFFSET + MembersOrderPreferencePage.getFieldOffset(Flags.isStatic(flags));
						}
					case IJavaElement.INITIALIZER: {