#5188 Add special for deleting sequence
authorCherian Mathew <c.mathew@bgbm.org>
Thu, 3 Sep 2015 13:37:47 +0000 (15:37 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Thu, 3 Sep 2015 13:38:47 +0000 (15:38 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/DeleteDerivateOperation.java

index 9706247d6a8b3807b1024889752dfb298aeed1cd..c43cd7c04805809430de9b265e9432b00b141eeb 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.ui.ISaveablePart;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
@@ -80,8 +81,9 @@ public class DeleteDerivateOperation extends AbstractPostOperation<CdmBase> {
                 && treeNode.getParent().getValue() instanceof Sequence){
             deleteResult = CdmStore.getService(IOccurrenceService.class).deleteSingleRead(((SingleRead)element).getUuid(),
                     ((Sequence) treeNode.getParent().getValue()).getUuid());
-        }
-        else{
+        } else if(element instanceof Sequence){
+            deleteResult = CdmStore.getService(ISequenceService.class).delete(element.getUuid(), deleteConfigurator);
+        } else {
             deleteResult = CdmStore.getService(IOccurrenceService.class).deleteDerivateHierarchy(element.getUuid(), deleteConfigurator);
         }
         if(deleteResult.isOk()){