Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2010-06-15 10:39:55 +0000
committerDani Megert2010-06-15 10:39:55 +0000
commit58adaefd3bf007821a87e974b589f3c0b155bf0a (patch)
tree33262166e903e4f3bcd03178735dfff515c5f358 /org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
parent97bc2a56ffe0abf513e8583568187ccdcff6e7be (diff)
downloadeclipse.platform.text-58adaefd3bf007821a87e974b589f3c0b155bf0a.tar.gz
eclipse.platform.text-58adaefd3bf007821a87e974b589f3c0b155bf0a.tar.xz
eclipse.platform.text-58adaefd3bf007821a87e974b589f3c0b155bf0a.zip
Fixed bug 309169: [templates] Templates > New Template > context list not sorted
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java')
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
index 14169ede4a2..a6593a02d65 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
@@ -20,6 +20,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -130,6 +132,7 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
import org.eclipse.ui.texteditor.IUpdate;
+
/**
* A template preference page allows configuration of the templates for an
* editor. It provides controls for adding, removing and changing templates as
@@ -248,6 +251,12 @@ public abstract class TemplatePreferencePage extends PreferencePage implements I
TemplateContextType type= (TemplateContextType) it.next();
contexts.add(new String[] { type.getId(), type.getName() });
}
+ Collections.sort(contexts, new Comparator() {
+ Collator collator= Collator.getInstance();
+ public int compare(Object o1, Object o2) {
+ return collator.compare(((String[])o1)[1], ((String[])o2)[1]);
+ }
+ });
fContextTypes= (String[][]) contexts.toArray(new String[contexts.size()][]);
fValidationStatus= new StatusInfo();

Back to the top