X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.eclipse.ui%2Fsrc%2Forg%2Fargeo%2Feclipse%2Fui%2Fjcr%2Flists%2FNodeViewerComparator.java;h=341b3abee17a284d57ca81f6c21d1d22cc986c5f;hb=4e5217621733b3f8b9c2427a688a18c68dbc1e5d;hp=a0f5b13f4534dea56ea27d6abcbcb5c1b6c30ceb;hpb=261af6b864de167e10eed1916f83035cca71d32f;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/lists/NodeViewerComparator.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/lists/NodeViewerComparator.java index a0f5b13f4..341b3abee 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/lists/NodeViewerComparator.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/lists/NodeViewerComparator.java @@ -9,7 +9,7 @@ import javax.jcr.RepositoryException; import javax.jcr.Value; import javax.jcr.ValueFormatException; -import org.argeo.ArgeoException; +import org.argeo.eclipse.ui.EclipseUiException; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; @@ -20,7 +20,7 @@ import org.eclipse.jface.viewers.ViewerComparator; * Note that the following snippet must be added before setting the comparator * to the corresponding control: * // IMPORTANT: initialize comparator before setting it - * ColumnDefinition firstCol = colDefs.get(0); + * JcrColumnDefinition firstCol = colDefs.get(0); * comparator.setColumn(firstCol.getPropertyType(), * firstCol.getPropertyName()); * viewer.setComparator(comparator); @@ -51,7 +51,6 @@ public class NodeViewerComparator extends ViewerComparator { long lc = 0; try { - Node n1 = (Node) e1; Node n2 = (Node) e2; @@ -90,10 +89,8 @@ public class NodeViewerComparator extends ViewerComparator { ; lc = c1.getTimeInMillis() - c2.getTimeInMillis(); if (lc < Integer.MIN_VALUE) - // rc = Integer.MIN_VALUE; rc = -1; else if (lc > Integer.MAX_VALUE) - // rc = Integer.MAX_VALUE; rc = 1; else rc = (int) lc; @@ -101,7 +98,7 @@ public class NodeViewerComparator extends ViewerComparator { case PropertyType.LONG: long l1; long l2; - // FIXME sometimes an empty string is set instead of a long + // TODO Sometimes an empty string is set instead of a long try { l1 = v1.getLong(); } catch (ValueFormatException ve) { @@ -132,7 +129,7 @@ public class NodeViewerComparator extends ViewerComparator { rc = d1.compareTo(d2); break; default: - throw new ArgeoException( + throw new EclipseUiException( "Unimplemented comparaison for PropertyType " + propertyType); } @@ -142,7 +139,7 @@ public class NodeViewerComparator extends ViewerComparator { } } catch (RepositoryException re) { - throw new ArgeoException("Unexpected error " + throw new EclipseUiException("Unexpected error " + "while comparing nodes", re); } return rc; @@ -190,4 +187,4 @@ public class NodeViewerComparator extends ViewerComparator { protected void setDirection(int direction) { this.direction = direction; } -} \ No newline at end of file +}