]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeComparator.java
Fix file download for rap. Add various links in the bundle detail editor.
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / controllers / DistTreeComparator.java
index 5bfbc98a8630f55024d123b33c05b8716147269a..c5b17e089266ee529756a9cc8dddd611661595c0 100644 (file)
@@ -1,13 +1,14 @@
 package org.argeo.slc.client.ui.dist.controllers;
 
 import org.argeo.slc.client.ui.dist.model.DistParentElem;
-import org.argeo.slc.client.ui.dist.model.GroupElem;
+import org.argeo.slc.client.ui.dist.model.ModularDistVersionElem;
 import org.argeo.slc.client.ui.dist.model.RepoElem;
+import org.argeo.slc.client.ui.dist.model.WkspGroupElem;
 import org.argeo.slc.client.ui.dist.model.WorkspaceElem;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerComparator;
 
-/** Specific behaviour to enhence Distribution tree browsers */
+/** Specific comparator to enhance Distribution tree browsers */
 public class DistTreeComparator extends ViewerComparator {
 
        public int category(Object element) {
@@ -17,7 +18,7 @@ public class DistTreeComparator extends ViewerComparator {
                                return 2;
                        else
                                return 5;
-               else if (element instanceof GroupElem)
+               else if (element instanceof WkspGroupElem)
                        return 10;
                else if (element instanceof WorkspaceElem)
                        return 15;
@@ -36,14 +37,14 @@ public class DistTreeComparator extends ViewerComparator {
                String s1, s2;
 
                if (e1 instanceof DistParentElem) {
-                       s1 = ((DistParentElem) e1).getLabel();
-                       s2 = ((DistParentElem) e2).getLabel();
+                       s1 = ((DistParentElem) e1).getName();
+                       s2 = ((DistParentElem) e2).getName();
                } else {
                        s1 = e1.toString();
                        s2 = e2.toString();
                }
 
-               if (e1 instanceof WorkspaceElem)
+               if (e1 instanceof WorkspaceElem || e1 instanceof ModularDistVersionElem)
                        // Reverse order for versions
                        return s2.compareTo(s1);
                else