Sort classifications in dropdown of taxon node selection dialog (#5184)
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 21 Sep 2015 15:56:03 +0000 (17:56 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 22 Sep 2015 08:01:21 +0000 (10:01 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java

index 348f2ccad55917cda73ccb4d41ab4129a3c78c2a..24f6125eb59ee0f239bb50680f3930db4c7b9634 100644 (file)
@@ -3,6 +3,8 @@
  */
 package eu.etaxonomy.taxeditor.ui.dialog.selection;
 
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.UUID;
 
@@ -125,6 +127,13 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
 
                if(classifications == null){
                        classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, null);
+                       Collections.sort(classifications, new Comparator<Classification>() {
+
+                @Override
+                public int compare(Classification o1, Classification o2) {
+                    return o1.getTitleCache().compareTo(o2.getTitleCache());
+                }
+            });
                        selectedClassification = classifications.iterator().next();
                }