import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.core.runtime.IStatus;\r
\r
+import eu.etaxonomy.cdm.model.taxon.ITreeNode;\r
import eu.etaxonomy.cdm.model.taxon.Synonym;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
\r
/**\r
* Change the taxonomic parent of a given taxon.\r
\r
private Taxon newTaxon;\r
private Synonym synonym;\r
- private TaxonNode parentNode;\r
+ private ITreeNode parentNode;\r
\r
private TaxonNode newNode;\r
\r
public ChangeSynonymToAcceptedTaxonOperation(String label, IUndoContext undoContext,\r
- Taxon taxon, TaxonNode parentNode, Synonym synonym, IPostOperationEnabled postOperationEnabled) {\r
+ Taxon taxon, ITreeNode parentNode, Synonym synonym, IPostOperationEnabled postOperationEnabled) {\r
super(label, undoContext, taxon, postOperationEnabled);\r
\r
this.parentNode = parentNode;\r
public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
throws ExecutionException {\r
\r
- newTaxon = Taxon.NewInstance(synonym.getName(), taxon.getSec());\r
+ newTaxon = CdmStore.getTaxonService().makeSynonymAcceptedTaxon(synonym, taxon);\r
\r
// TODO let user choose parent\r
- newNode = parentNode.addChild(newTaxon);\r
- \r
- taxon.removeSynonym(synonym);\r
- \r
+ newNode = parentNode.addChildTaxon(newTaxon, null, null, null);\r
+ \r
return postExecute(newNode);\r
}\r
\r