Community
Participate
Working Groups
Created attachment 230207 [details] Project explorer Project explorer doesn't take space into account while sorting projects. It is different in Package explorer, it takes space into account. It is a problem with large number of projects(it is confusing). Attaching screen shots which shows difference.
Created attachment 230208 [details] Package explorer
The problem is that the Collator used by the CommonNavigator is the default Java Collator which ignores white space. For the package explorer, I would imagine they have their own Collator implementation that handles all of the Java names properly. The solution to this is probably to use a non-default Collator in the ResourceSorter (and probably change ResourceComparator as well) which pays attention to the spaces. Those classes are part of Navigator. It will take a bit of research to figure how how to make the desired Collator; any community contribution is welcome.
(In reply to comment #2) > The problem is that the Collator used by the CommonNavigator is the default > Java Collator which ignores white space. For the package explorer, I would > imagine they have their own Collator implementation that handles all of the > Java names properly. > JDT would use the com.ibm.icu.text.Collator PW
Making a change like this should be done early in a release. It means ResourceSorter can't use ViewerSorter.
When I run the Project Explorer with no fix, I get the same sorting as the Package Explorer. So it works for me. What version of java are you using? What is your LANG/Locale set to? Mine is en_US.UTF-8 It might be your locale is set to something that ignores spaces. PW
(In reply to comment #5) > When I run the Project Explorer with no fix, I get the same sorting as the > Package Explorer. So it works for me. > > What version of java are you using? What is your LANG/Locale set to? Mine > is en_US.UTF-8 > > It might be your locale is set to something that ignores spaces. > > PW I do see it on my Windows 7 machine with file.encoding=Cp1252 user.country=CH user.language=de At this point the safest fix would be to add #compareNames(IResource, IResource) to ResourceExtensionSorter and use the ICU collator there.
(In reply to comment #6) > > > At this point the safest fix would be to add #compareNames(IResource, > IResource) to ResourceExtensionSorter and use the ICU collator there. OK, that's the change Francis suggests: https://git.eclipse.org/r/#/c/12823/ Dani, could you review it as you can reproduce the problem? PW
I was able to reproduce the problem on my Mac, I did not try it on Linux. (In reply to comment #5) > When I run the Project Explorer with no fix, I get the same sorting as the > Package Explorer. So it works for me. > > What version of java are you using? What is your LANG/Locale set to? Mine > is en_US.UTF-8 > > It might be your locale is set to something that ignores spaces. > > PW
(In reply to comment #7) > (In reply to comment #6) > > > > > > At this point the safest fix would be to add #compareNames(IResource, > > IResource) to ResourceExtensionSorter and use the ICU collator there. > > OK, that's the change Francis suggests: https://git.eclipse.org/r/#/c/12823/ > > Dani, could you review it as you can reproduce the problem? > > PW Nope, that's not what he suggests. His change modifies the API class ResourceSorter. Nothing I would approve at this time.
> Dani, could you review it as you can reproduce the problem? My pleasure!
(In reply to comment #9) > > Nope, that's not what he suggests. His change modifies the API class > ResourceSorter. Nothing I would approve at this time. I fixed it to make the more local change.
Latest patch set: https://git.eclipse.org/r/#/c/12834/ PW
(In reply to comment #12) > Latest patch set: https://git.eclipse.org/r/#/c/12834/ > > PW Thanks Francis. Change submitted with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=af118d3e3b15987887f3b28a4e1d3acafe0b61f3
Verified fixed. in 4.3.0.I20130516-2200, Win/7/64, IBM 1.7 JRE