-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
*/
public CreateTaxonNode(String label,
IUndoContext undoContext,
- ITaxonTreeNode parentNode, TaxonNameBase<?, ?> name,
+ TaxonNodeDto parentNode, TaxonName name,
IPostOperationEnabled postOperationEnabled,
IConversationEnabled conversationEnabled,
ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
*/
public CreateTaxonNode(String label,
IUndoContext undoContext,
- ITaxonTreeNode parentNode,
+ TaxonNodeDto parentNode,
Taxon taxon,
IPostOperationEnabled postOperationEnabled,
IConversationEnabled conversationEnabled,
// add the taxon
bind();
monitor.worked(20);
- childTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference());
+ TaxonNode node = CdmStore.getService(ITaxonNodeService.class).find(parentNode.getUuid());
+ childTaxonNode = node.addChildTaxon(newTaxon, node.getReference(), node.getMicroReference());
monitor.worked(40);
return postExecute(childTaxonNode);
}catch(Exception e){
- MessagingUtils.messageDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
+ MessagingUtils.messageDialog(Messages.CreateTaxonNode_CREATE_FAILED, getClass(), e.getLocalizedMessage(), e);
return Status.CANCEL_STATUS;
}
}
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- MessagingUtils.warn(this.getClass(), "Not yet implemented.");
+ MessagingUtils.warn(this.getClass(), "Not yet implemented."); //$NON-NLS-1$
return null;
}
}