]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ResultItemsComparator.java
enhance management of context menus and commands. Remove a few bugs.
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui / src / main / java / org / argeo / slc / client / ui / model / ResultItemsComparator.java
index 8ea293af1dcbea39d0d5172b1d32c0f0f7226533..30e7baa44a81f062cdd1f011abbfa575b07a4842 100644 (file)
@@ -72,11 +72,24 @@ public class ResultItemsComparator extends ViewerComparator {
                        } catch (RepositoryException e) {
                                throw new SlcException("Unable to compare date created", e);
                        }
-               } else
-                       // only remaining objects for the time being
-                       // NT_UNSTRUCTURED that display all result tree structures
-                       // We want the newest folders first
-                       result = super.compare(viewer, e1, e2) * -1;
+               } else if (e1 instanceof ParentNodeFolder
+                               && e2 instanceof ParentNodeFolder) {
+                       try {
+                               Node an = ((ParentNodeFolder) e1).getNode();
+                               // under my Result
+                               if (an.isNodeType(SlcTypes.SLC_MY_RESULT_ROOT_FOLDER)
+                                               || an.isNodeType(SlcTypes.SLC_RESULT_FOLDER)) {
+                                       result = super.compare(viewer, e1, e2);
+                               } else {
+                                       // only remaining objects for the time being
+                                       // NT_UNSTRUCTURED that display all result tree structures
+                                       // We want the newest folders first
+                                       result = super.compare(viewer, e1, e2) * -1;
+                               }
+                       } catch (RepositoryException e) {
+                               throw new SlcException("Unable to compare date created", e);
+                       }
+               }
                return result;
        }
-}
+}
\ No newline at end of file