X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FResultItemsComparer.java;fp=org.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FResultItemsComparer.java;h=0000000000000000000000000000000000000000;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=14b9b068f7e641dba1dccdd32a03ebb47bd24dba;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/ResultItemsComparer.java b/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/ResultItemsComparer.java deleted file mode 100644 index 14b9b068f..000000000 --- a/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/ResultItemsComparer.java +++ /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(); - } - -}