sort entities by fieldname in InspectSessionsDialog
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / sessions / InspectSessionsDialog.java
index 3a227aef961e1d4813f69ee0d364048f0f78a2d3..eedfd4bce39a67d9da9b7b5abd8e4a9ffbf8f99f 100644 (file)
@@ -8,6 +8,7 @@
  */
 package eu.etaxonomy.taxeditor.view.sessions;
 
+import java.util.Collections;
 import java.util.List;
 
 import org.eclipse.jface.viewers.ILabelProvider;
@@ -174,6 +175,11 @@ public class InspectSessionsDialog extends Dialog {
         @Override
         public Object[] getChildren(Object parentElement) {
             List<CdmEntityInfo> children = ((CdmEntityInfo)parentElement).getChildren();
+            Collections.sort(children, (c1, c2)->{
+                String str1 = (c1 == null) ? "": c1.getLabel();
+                String str2 = (c2 == null) ? "": c2.getLabel();
+                return str1.compareTo(str2);
+            });
             return children.toArray();
         }
 
@@ -219,7 +225,6 @@ public class InspectSessionsDialog extends Dialog {
 
         @Override
         public Image getImage(Object element) {
-            // TODO Auto-generated method stub
             return null;
         }