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;
/**
private final PolytomousKeyNode parentNode;
private PolytomousKeyNode childNode;
+ /**
+ *
+ */
+ protected IPostOperationEnabled postOperationEnabled;
public PolytomousKeyNode getChildNode() {
return childNode;
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)
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;
+ }
}
+
+
+
+
+
}