add real deletion of polytomouskeynodes
authorKatja Luther <k.luther@bgbm.org>
Wed, 20 Nov 2013 09:42:15 +0000 (09:42 +0000)
committerKatja Luther <k.luther@bgbm.org>
Wed, 20 Nov 2013 09:42:15 +0000 (09:42 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java

index dc054de2ef665819867a72509840b0edf4e498c5..25bef92d7760429f17f85696e4c2ddcd2e1cf151 100644 (file)
@@ -9,9 +9,13 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationController;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author n.hoffmann
 
 /**
  * @author n.hoffmann
@@ -40,7 +44,14 @@ public class DeleteNodeOperation extends AbstractPostOperation {
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
-               parent.removeChild(node);
+               //parent.removeChild(node);
+               CdmApplicationController controller;
+               
+               controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+               
+               IPolytomousKeyNodeService service = controller.getPolytomousKeyNodeService();
+               
+               service.delete(node, true);
 
                return postExecute(null);
        }
 
                return postExecute(null);
        }