]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ResultItemsComparer.java
SLC UI building (except Dist)
[gpl/argeo-slc.git] / org.argeo.slc.client.ui / src / main / java / org / argeo / slc / client / ui / model / ResultItemsComparer.java
diff --git a/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ResultItemsComparer.java b/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ResultItemsComparer.java
deleted file mode 100644 (file)
index 14b9b06..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.argeo.slc.client.ui.model;
-
-import javax.jcr.RepositoryException;
-
-import org.argeo.slc.SlcException;
-import org.eclipse.jface.viewers.IElementComparer;
-
-/**
- * Override default behaviour to insure that 2 distincts results that have the
- * same name will be correctly and distincly returned by corresponding
- * TreeViewer.getSelection() method.
- * 
- */
-public class ResultItemsComparer implements IElementComparer {
-       // private final static Log log =
-       // LogFactory.getLog(ResultItemsComparer.class);
-
-       public boolean equals(Object a, Object b) {
-               if (b == null)
-                       return a == null ? true : false;
-
-               if (a.hashCode() != b.hashCode() || !a.getClass().equals(b.getClass()))
-                       return false;
-               else if (a instanceof SingleResultNode) {
-                       try {
-                               String ida = ((SingleResultNode) a).getNode().getIdentifier();
-
-                               String idb = ((SingleResultNode) b).getNode().getIdentifier();
-
-                               if (ida.equals(idb))
-                                       return true;
-                               else
-                                       return false;
-
-                       } catch (RepositoryException e) {
-                               throw new SlcException("Cannot compare single reult nodes", e);
-                       }
-               } else
-                       return true;
-       }
-
-       public int hashCode(Object element) {
-               return element.hashCode();
-       }
-
-}