aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Upton IV2013-05-15 11:45:37 (EDT)
committerGerrit Code Review @ Eclipse.org2013-05-15 15:34:01 (EDT)
commitaf118d3e3b15987887f3b28a4e1d3acafe0b61f3 (patch)
treeadfc0bbee4c7c93124c55d10edef770bf8a435fa
parent942e10f671c59914488f2becf7d82a9b8aa344d5 (diff)
downloadeclipse.platform.ui-af118d3e3b15987887f3b28a4e1d3acafe0b61f3.zip
eclipse.platform.ui-af118d3e3b15987887f3b28a4e1d3acafe0b61f3.tar.gz
eclipse.platform.ui-af118d3e3b15987887f3b28a4e1d3acafe0b61f3.tar.bz2
bug 406723 [Navigator] Confusing alphabetical sort order in projectrefs/changes/34/12834/3
explorer and resource navigator Change-Id: If6c1148f9a9af500bf24aba1fbf3e8ca32fb25fc
-rw-r--r--bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionSorter.java14
2 files changed, 15 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
index e319af1..639ff92 100644
--- a/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
@@ -24,3 +24,4 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.6.0,4.0.0)",
org.eclipse.ltk.ui.refactoring;bundle-version="[3.5.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-ActivationPolicy: lazy
+Import-Package: com.ibm.icu.text
diff --git a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionSorter.java b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionSorter.java
index a3c7904..4e19c1b 100644
--- a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionSorter.java
+++ b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionSorter.java
@@ -11,11 +11,16 @@
package org.eclipse.ui.internal.navigator.resources.workbench;
+
+
// Sadly, there is nothing that can be done about these warnings, as
// the INavigatorSorterService has a method that returns a ViewerSorter, so
// we can't convert this to a ViewerComparator.
+import org.eclipse.core.resources.IResource;
import org.eclipse.ui.views.navigator.ResourceSorter;
+import com.ibm.icu.text.Collator;
+
/**
* TODO - This refers to the deprecated ResourceSorter, however we are stuck with this
* for the time being because the CommonSorter extension point uses a ViewerSorter.
@@ -27,6 +32,8 @@ import org.eclipse.ui.views.navigator.ResourceSorter;
*/
public class ResourceExtensionSorter extends ResourceSorter {
+ private Collator icuCollator;
+
/**
* Construct a sorter that uses the name of the resource as its sorting
* criteria.
@@ -34,5 +41,12 @@ public class ResourceExtensionSorter extends ResourceSorter {
*/
public ResourceExtensionSorter() {
super(ResourceSorter.NAME);
+ icuCollator = Collator.getInstance();
}
+
+ protected int compareNames(IResource resource1, IResource resource2) {
+ return icuCollator.compare(resource1.getName(), resource2.getName());
+ }
+
+
}