Delete unused classes
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 7 Oct 2015 09:03:46 +0000 (11:03 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 7 Oct 2015 09:03:46 +0000 (11:03 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateContentProvider.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateLabelProvider.java [deleted file]

diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateContentProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateContentProvider.java
deleted file mode 100644 (file)
index 20b65e2..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter;
-
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.jface.viewers.Viewer;
-
-import eu.etaxonomy.cdm.model.molecular.DnaSample;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
-
-public class DerivateContentProvider implements ITreeContentProvider {
-
-    List<TreeNode> rootNodes;
-
-       @Override
-       public void dispose() {
-               // TODO Auto-generated method stub
-
-       }
-
-       public List<SpecimenOrObservationBase> getRootElements() {
-           List<SpecimenOrObservationBase> elements = new ArrayList<SpecimenOrObservationBase>();
-
-           if(rootNodes != null) {
-               for(TreeNode node : rootNodes) {
-                   elements.add((SpecimenOrObservationBase)node.getValue());
-               }
-           }
-           return elements;
-       }
-
-       @Override
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-       }
-
-       @Override
-       public Object[] getElements(Object inputElement) {
-           rootNodes = new ArrayList<TreeNode>();
-           if(inputElement instanceof Set){
-               for (Object o: (Set)inputElement) {
-                   if(o instanceof SpecimenOrObservationBase){
-                       SpecimenOrObservationBase<?> rootElement = (SpecimenOrObservationBase<?>)o;
-                       if(rootElement!=null){
-                           rootNodes.add(new TreeNode(rootElement));
-                       }
-                   }
-            }
-           }
-           return rootNodes.toArray();
-       }
-
-       @Override
-       public Object[] getChildren(Object element) {
-           TreeNode currentnode = null;
-           Object value = null;
-        if(element instanceof TreeNode){
-            currentnode = (TreeNode) element;
-            value = ((TreeNode) element).getValue();
-        }
-        Set<Object> children = new LinkedHashSet<Object>();
-        if(value instanceof DnaSample && ((DnaSample) value).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-            DnaSample dnaSample = (DnaSample)value;
-            Set<Sequence> sequences = dnaSample.getSequences();
-            for (Sequence sequence : sequences) {
-                TreeNode node = new TreeNode(sequence);
-                node.setParent(currentnode);
-                children.add(node);
-            }
-        }
-        else if(value instanceof Sequence){
-            Set<SingleRead> singleReads = ((Sequence) value).getSingleReads();
-            for(SingleRead singleRead:singleReads){
-                TreeNode node = new TreeNode(singleRead);
-                node.setParent(currentnode);
-                children.add(node);
-            }
-            return children.toArray();
-        }
-
-        if(value instanceof SpecimenOrObservationBase){
-               List<DerivedUnit> derivates = getDerivates((SpecimenOrObservationBase<?>) value);
-               for (DerivedUnit derivedUnit:derivates) {
-                TreeNode node = new TreeNode(derivedUnit);
-                node.setParent(currentnode);
-                children.add(node);
-            }
-            return children.toArray();
-           }
-           return null;
-       }
-
-       @Override
-       public Object getParent(Object element) {
-        if(element instanceof TreeNode){
-            return ((TreeNode) element).getParent();
-        }
-               return null;
-       }
-
-       @Override
-       public boolean hasChildren(Object element) {
-        if(element instanceof TreeNode){
-            element = ((TreeNode) element).getValue();
-        }
-
-        if(element instanceof DnaSample && ((DnaSample) element).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-            DnaSample dnaSample = (DnaSample)element;
-            if(!dnaSample.getSequences().isEmpty()){// || !dnaSample.getAmplifications().isEmpty()){
-                return true;
-            }
-        }
-        else if(element instanceof Sequence){
-            return !((Sequence)element).getSingleReads().isEmpty();
-        }
-
-        if(element instanceof SpecimenOrObservationBase){
-               SpecimenOrObservationBase<?> specimenOrObservation = (SpecimenOrObservationBase<?>)element;
-               for(DerivationEvent event:specimenOrObservation.getDerivationEvents()){
-                   if(!event.getDerivatives().isEmpty()){
-                       return true;
-                   }
-               }
-           }
-               return false;
-       }
-
-       private List<DerivedUnit> getDerivates(SpecimenOrObservationBase<?> specimenOrObservation){
-           List<DerivedUnit> derivates = new ArrayList<DerivedUnit>();
-           for(DerivationEvent derivationEvent:specimenOrObservation.getDerivationEvents()){
-               derivates.addAll(derivationEvent.getDerivatives());
-           }
-           return derivates;
-       }
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateLabelProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateLabelProvider.java
deleted file mode 100644 (file)
index 42b1d5c..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2013 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter;
-
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.swt.graphics.Image;
-import org.hibernate.LazyInitializationException;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.DefinedTerm;
-import eu.etaxonomy.cdm.model.common.Identifier;
-import eu.etaxonomy.cdm.model.molecular.DnaSample;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
-import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
-import eu.etaxonomy.taxeditor.model.ImageResources;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * Label provider for the views to show {@link SpecimenOrObservationBase}s.<br>
- * <br>
- * <b>Note:</b> If you use this label provider you need to assure that you
- * created a {@link ConversationHolder} resp. have an open session because
- * the labels are generated from various fields of the derivate hierarchy which
- * are lazy loaded and could therefore throw a {@link LazyInitializationException}.<br>
- * Use <b>{@link #setConversation(ConversationHolder)}</b> to assign the session to this provider.
- */
-public class DerivateLabelProvider extends ColumnLabelProvider {
-
-    private static final String NO_SAMPLE_DESIGNATION = "[no sample designation]";
-
-    private Set<SingleRead> multiLinkSingleReads;
-
-    private ConversationHolder conversation;
-
-    private static DefinedTerm photoTerm = null;
-    private static DefinedTerm drawingTerm = null;
-    private static DefinedTerm specimenScanTerm = null;
-    private static DefinedTerm detailImageTerm = null;
-    private static DefinedTerm sampleDesignationTerm = null;
-
-    //FIXME: move static term getters to new singleton utility class
-    private static void initializeTerms() {
-        List<DefinedTerm> preferredTerms = CdmStore.getTermManager().getPreferredTerms(DefinedTerm.class);
-        for (DefinedTerm definedTerm : preferredTerms) {
-            if(definedTerm.getUuid().equals(UUID.fromString("c5c59c42-f254-471e-96c6-09f459f7c903"))){
-                photoTerm = definedTerm;
-            }
-            else if(definedTerm.getUuid().equals(UUID.fromString("669b0409-4aa4-4695-aae4-a95ed27bad4c"))){
-                drawingTerm = definedTerm;
-            }
-            else if(definedTerm.getUuid().equals(UUID.fromString("acda15be-c0e2-4ea8-8783-b9b0c4ad7f03"))){
-                specimenScanTerm = definedTerm;
-            }
-            else if(definedTerm.getUuid().equals(UUID.fromString("31eb8d02-bf5d-437c-bcc6-87a626445f34"))){
-                detailImageTerm = definedTerm;
-            }
-            else if(definedTerm.getUuid().equals(UUID.fromString("fadeba12-1be3-4bc7-9ff5-361b088d86fc"))){
-                sampleDesignationTerm = definedTerm;
-            }
-        }
-    }
-
-    public static DefinedTerm getLivingPlantPhotoTerm(){
-        if(photoTerm==null){
-            initializeTerms();
-        }
-        return photoTerm;
-    }
-
-    public static DefinedTerm getArtworkTerm(){
-        if(drawingTerm==null){
-            initializeTerms();
-        }
-        return drawingTerm;
-    }
-
-    public static DefinedTerm getSpecimenScanTerm(){
-        if(specimenScanTerm==null){
-            initializeTerms();
-        }
-        return specimenScanTerm;
-    }
-
-    public static DefinedTerm getDetailImageTerm(){
-        if(detailImageTerm==null){
-            initializeTerms();
-        }
-        return detailImageTerm;
-    }
-
-    public static DefinedTerm getSampleDesignationTerm(){
-        if(sampleDesignationTerm==null){
-            initializeTerms();
-        }
-        return sampleDesignationTerm;
-    }
-
-
-    /** {@inheritDoc} */
-    @Override
-    public String getText(Object element) {
-        return getDerivateText(element);
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String getToolTipText(Object element) {
-        return getDerivateText(element);
-    }
-
-    /**
-     * @param conversation the conversation to set
-     */
-    public void setConversation(ConversationHolder conversation) {
-        this.conversation = conversation;
-    }
-
-    public String getDerivateText(Object element){
-        return getDerivateText(element, conversation);
-    }
-
-    public static String getDerivateText(Object element, ConversationHolder conversation){
-        //TODO: use list of strings to assemble labels to avoid adding the separator every time and to allow null values
-        TreeNode parentNode = null;
-        TreeNode node = null;
-        Object derivate = element;
-        if(element instanceof TreeNode){
-            node = (TreeNode) element;
-            parentNode = node.getParent();
-            //unwrap specimen from TreeNode
-            derivate = node.getValue();
-        }
-
-        conversation.bind();
-
-        final String emptyString = "";
-        final String separator = " ";
-
-        String label = emptyString;
-
-        //Field Unit
-        if(derivate instanceof FieldUnit){
-            FieldUnit fieldUnit = (FieldUnit)derivate;
-            if(fieldUnit.getGatheringEvent()!=null){
-                GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
-                label += gatheringEvent.getCountry()!=null?gatheringEvent.getCountry().getLabel()+separator:emptyString;
-                label += gatheringEvent.getLocality()!=null?gatheringEvent.getLocality().getText()+separator:emptyString;
-                label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+separator:emptyString;
-                label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
-            }
-            label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber():emptyString;
-        }
-        //MediaSpecimen
-        else if(derivate instanceof MediaSpecimen){
-            MediaSpecimen mediaSpecimen = (MediaSpecimen)derivate;
-            if(mediaSpecimen.getMediaSpecimen()!=null){
-                label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+separator:"[no motif]";
-                label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+separator:emptyString;
-            }
-            eu.etaxonomy.cdm.model.occurrence.Collection collection = mediaSpecimen.getCollection();
-            if(collection!=null){
-                label += collection.getName()!=null?collection.getName()+" ":emptyString;
-                label += collection.getCode()!=null?"("+collection.getCode()+")"+separator:emptyString;
-            }
-            label += mediaSpecimen.getAccessionNumber()!=null?mediaSpecimen.getAccessionNumber()+separator:emptyString;
-            label += mediaSpecimen.getBarcode()!=null?mediaSpecimen.getBarcode()+separator:emptyString;
-        }
-        //TissueSample + DnaSample
-        else if(derivate instanceof DnaSample){
-            DnaSample dnaSample = (DnaSample)derivate;
-            if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
-                if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
-                    label += currentSampleDesignation.getIdentifier()+separator;
-                }
-                else{
-                    label += NO_SAMPLE_DESIGNATION+separator;
-                }
-            }
-            else if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.TissueSample){
-                if(dnaSample.getKindOfUnit()!=null){
-                    label += dnaSample.getKindOfUnit()+separator;
-                }
-                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
-                if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
-                    label += currentSampleDesignation.getIdentifier()+separator;
-                }
-                else{
-                    label += NO_SAMPLE_DESIGNATION+separator;
-                }
-            }
-
-        }
-        //DerivedUnit + TissueSample
-        else if(derivate instanceof DerivedUnit){
-            DerivedUnit derivedUnit = (DerivedUnit)derivate;
-            if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
-                //java.util.Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class).getFieldUnits(derivedUnit.getUuid());
-                //TODO : This is not generic anymore for performance reasons
-                Set<SpecimenOrObservationBase> originals = derivedUnit.getOriginals();
-                if(originals!=null && originals.size() ==1) {
-                    SpecimenOrObservationBase specimen = originals.iterator().next();
-                    if(specimen instanceof FieldUnit) {
-                        FieldUnit fieldUnit = (FieldUnit)specimen;
-                        GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
-                        if(gatheringEvent!=null){
-                            label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
-                        }
-                        label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+separator:emptyString;
-                    }
-                }
-
-                eu.etaxonomy.cdm.model.occurrence.Collection collection = derivedUnit.getCollection();
-                if(collection!=null){
-                    label += collection.getCode()!=null?"("+collection.getCode()+")"+separator:emptyString;
-                }
-                String mostSignificantIdentifier = derivedUnit.getMostSignificantIdentifier();
-                label += mostSignificantIdentifier!=null?mostSignificantIdentifier+separator:emptyString;
-            }
-            else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
-                //TissueSample should only be created by using it's own class
-                //in future using only one class with different SpecimenOrObservationTypes is desired
-//                label += derivedUnit.getKindOfUnit() + NO_SAMPLE_DESIGNATION;
-            }
-        }
-        //Sequence
-        else if(derivate instanceof Sequence){
-            Sequence sequence = (Sequence)derivate;
-            Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
-            if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
-                label += currentSampleDesignation.getIdentifier()+separator;
-            }
-            else{
-                label += NO_SAMPLE_DESIGNATION+separator;
-            }
-            label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():emptyString;
-        }
-        //SingleRead
-        else if(derivate instanceof SingleRead){
-            SingleRead singleRead = (SingleRead)derivate;
-            if(parentNode!=null && parentNode.getValue() instanceof Sequence){
-                Sequence sequence = (Sequence) parentNode.getValue();
-                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
-                if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
-                    label = currentSampleDesignation.getIdentifier()+separator;
-                }
-                else{
-                    label += NO_SAMPLE_DESIGNATION+separator;
-                }
-                label += singleRead.getPrimer()!=null?singleRead.getPrimer().getLabel()+separator:emptyString;
-                if(sequence!=null && sequence.getDnaMarker()!=null){
-                    label += sequence.getDnaMarker()+separator;
-                }
-                if(singleRead.getAmplificationResult()!=null && singleRead.getAmplificationResult().getAmplification()!=null){
-                    label += singleRead.getAmplificationResult().getAmplification().getLabelCache()+separator;
-                }
-            }
-        }
-        //SOOB
-        else if(derivate instanceof SpecimenOrObservationBase){
-            SpecimenOrObservationBase<?> specimen = (SpecimenOrObservationBase<?>) derivate;
-            SpecimenOrObservationType type = specimen.getRecordBasis();
-            return specimen.getTitleCache() + (type!=null?" ["+type.toString()+"]":emptyString);
-        }
-        if(label.isEmpty()){
-            label = derivate.toString();
-        }
-        //remove last comma
-        else if(label.endsWith(separator)){
-            label = label.substring(0, label.length()-separator.length());
-        }
-        return label;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
-     */
-    @Override
-    public Image getImage(Object element) {
-        if(element instanceof TreeNode){
-            element = ((TreeNode) element).getValue();
-        }
-        if(element instanceof CdmBase){
-            CdmBase cdmBase = (CdmBase)element;
-            boolean hasCharacterData = false;
-            if(cdmBase.isInstanceOf(SpecimenOrObservationBase.class)){
-                SpecimenOrObservationBase<?> specimen = HibernateProxyHelper.deproxy(cdmBase, SpecimenOrObservationBase.class);
-                if(specimen.hasCharacterData()){
-                    hasCharacterData = true;
-                }
-            }
-            if(cdmBase.isInstanceOf(FieldUnit.class)){
-                return hasCharacterData?ImageResources.getImage(ImageResources.FIELD_UNIT_CHARACTER_DATA):ImageResources.getImage(ImageResources.FIELD_UNIT);
-            }
-            else if(cdmBase.isInstanceOf(DerivedUnit.class)){
-                DerivedUnit derivedUnit = HibernateProxyHelper.deproxy(element, DerivedUnit.class);
-                if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.FieldUnit){
-                    return hasCharacterData?ImageResources.getImage(ImageResources.FIELD_UNIT_CHARACTER_DATA):ImageResources.getImage(ImageResources.FIELD_UNIT);
-                }
-                else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                    return hasCharacterData?ImageResources.getImage(ImageResources.DNA_SAMPLE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.DNA_SAMPLE_DERIVATE);
-                }
-                else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
-                    return hasCharacterData?ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE);
-                }
-                else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
-                    return hasCharacterData?ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE);
-                }
-                else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.Media){
-                    if(derivedUnit.getKindOfUnit()!=null){
-                        if(derivedUnit.getKindOfUnit().equals(getArtworkTerm())){
-                            return hasCharacterData?ImageResources.getImage(ImageResources.ARTWORK_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.ARTWORK_DERIVATE);
-                        }
-                        else if(derivedUnit.getKindOfUnit().equals(getLivingPlantPhotoTerm())){
-                            return hasCharacterData?ImageResources.getImage(ImageResources.LIVING_PLANT_PHOTO_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.LIVING_PLANT_PHOTO_DERIVATE);
-                        }
-                        else if(derivedUnit.getKindOfUnit().equals(getSpecimenScanTerm())){
-                            return hasCharacterData?ImageResources.getImage(ImageResources.SPECIMEN_SCAN_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.SPECIMEN_SCAN_DERIVATE);
-                        }
-                        else if(derivedUnit.getKindOfUnit().equals(getDetailImageTerm())){
-                            return hasCharacterData?ImageResources.getImage(ImageResources.DETAIL_IMAGE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.DETAIL_IMAGE_DERIVATE);
-                        }
-                    }
-                }
-            }
-            else if(cdmBase.isInstanceOf(Sequence.class)){
-                return ImageResources.getImage(ImageResources.SEQUENCE_DERIVATE);
-            }
-
-            else if(cdmBase.isInstanceOf(SingleRead.class)){
-                if(multiLinkSingleReads.contains(element)){
-                    return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE_MULTILINK);
-                }
-                else{
-                    return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE);
-                }
-            }
-        }
-        return super.getImage(element);
-    }
-
-    public static Identifier<DnaSample> getCurrentSampleDesignation(CdmBase entity) {
-        if(entity.isInstanceOf(DnaSample.class)){
-            DnaSample dnaSample = HibernateProxyHelper.deproxy(entity, DnaSample.class);
-            for (Identifier<DnaSample> identifier : dnaSample.getIdentifiers()) {
-                if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
-                    //first sample designation is the current
-                    return identifier;
-                }
-            }
-        }
-        else if(entity.isInstanceOf(Sequence.class)){
-            Sequence sequence = HibernateProxyHelper.deproxy(entity, Sequence.class);
-            if(sequence.getDnaSample()!=null){
-                return getCurrentSampleDesignation(sequence.getDnaSample());
-            }
-        }
-        return null;
-    }
-
-    /**
-     * @param multiLinkSingleReads2
-     */
-    public void setMultiLinkSingleReads(Set<SingleRead> multiLinkSingleReads) {
-        this.multiLinkSingleReads = multiLinkSingleReads;
-    }
-
-}