additional delete functionality to bulkeditor
authorKatja Luther <k.luther@bgbm.org>
Thu, 20 Feb 2014 09:11:21 +0000 (09:11 +0000)
committerKatja Luther <k.luther@bgbm.org>
Thu, 20 Feb 2014 09:11:21 +0000 (09:11 +0000)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java

index 1105555db60adf237d0afa48ff895f51b6ef14d1..93e2682ccd2f973833df684ba01dbbab414e917b 100644 (file)
@@ -20,13 +20,18 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 
+import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.name.NameRelationship;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
@@ -93,8 +98,13 @@ public class DeleteHandler extends AbstractHandler {
                                                }else if (object instanceof User){
                                                        IUserService service = controller.getUserService();
                                                        service.delete((User) object);
+                                               } else if (object instanceof TaxonNameBase){
+                                                       INameService service = controller.getNameService();
+                                                       service.delete((TaxonNameBase)object);
+                                               } else if (object instanceof TeamOrPersonBase){
+                                                       IAgentService service = controller.getAgentService();
+                                                       service.delete((TeamOrPersonBase)object);
                                                }
-                                               
                                        } catch (Exception e){
                                                BulkEditorUtil.errorDialog("Could not delete", getClass(), e.getMessage(), null);
                                        }