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;
* Note that the following snippet must be added before setting the comparator
* to the corresponding control: <code>
* // 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); </code>
*/
public class NodeViewerComparator extends ViewerComparator {
+ private static final long serialVersionUID = -7782916140737279027L;
protected String propertyName;
long lc = 0;
try {
-
Node n1 = (Node) e1;
Node n2 = (Node) e2;
;
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;
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) {
rc = d1.compareTo(d2);
break;
default:
- throw new ArgeoException(
+ throw new EclipseUiException(
"Unimplemented comparaison for PropertyType "
+ propertyType);
}
}
} catch (RepositoryException re) {
- throw new ArgeoException("Unexpected error "
+ throw new EclipseUiException("Unexpected error "
+ "while comparing nodes", re);
}
return rc;