]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/util/JcrItemsComparator.java
1 package org
.argeo
.eclipse
.ui
.jcr
.util
;
3 import java
.util
.Comparator
;
6 import javax
.jcr
.RepositoryException
;
8 import org
.argeo
.eclipse
.ui
.EclipseUiException
;
10 /** Compares two JCR items (node or properties) based on their names. */
11 public class JcrItemsComparator
implements Comparator
<Item
> {
12 public int compare(Item o1
, Item o2
) {
14 // TODO: put folder before files
15 return o1
.getName().toLowerCase().compareTo(o2
.getName().toLowerCase());
16 } catch (RepositoryException e
) {
17 throw new EclipseUiException("Cannot compare " + o1
+ " and " + o2
, e
);