all polytomouskey related handler are now extended from RemotingCdmHandler
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / key / polytomous / operation / RemotingCreatePolytomousKeyNodeOperation.java
index 4674f28c0b53308655c5fffb1e73a7643540ba3a..57a44bd9cc7e0d24885f2966398709f4fc5560d0 100644 (file)
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.operation.RemotingCdmDefaultOperation;
 
 /**
@@ -26,6 +27,10 @@ public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmDefault
 
     private final PolytomousKeyNode parentNode;
     private PolytomousKeyNode childNode;
+    /**
+    *
+    */
+   protected IPostOperationEnabled postOperationEnabled;
 
     public PolytomousKeyNode getChildNode() {
         return childNode;
@@ -35,9 +40,10 @@ public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmDefault
 
     public RemotingCreatePolytomousKeyNodeOperation(Object source,
             boolean async,
-            PolytomousKeyNode parentNode){
+            PolytomousKeyNode parentNode, IPostOperationEnabled postOperationEnabled){
         super(LABEL, Action.Create, source, async);
         this.parentNode = parentNode;
+        this.postOperationEnabled = postOperationEnabled;
     }
 
     /* (non-Javadoc)
@@ -47,7 +53,16 @@ public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmDefault
     protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
       childNode = PolytomousKeyNode.NewInstance();
       parentNode.addChild(childNode);
-      return childNode;
+      if (postOperationEnabled.postOperation(childNode)){
+          return childNode;
+      }else {
+          return null;
+      }
     }
 
+
+
+
+
+
 }