Merge branch 'develop' into remoting-4.0
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / operation / CreateTaxonNode.java
index 98915188d46aafba3974f227add2b43d0c12f2c1..495f009dc3a942b01143ef4d471268dbe7b48801 100644 (file)
@@ -23,11 +23,11 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>CreateTaxonNodeOperation class.</p>
@@ -39,7 +39,7 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 @Deprecated // we do not undo creation of elements
 public class CreateTaxonNode extends AbstractPersistentPostOperation {
 
-       private Taxon newTaxon;
+       private final Taxon newTaxon;
 
        private TaxonNode childTaxonNode;
 
@@ -53,10 +53,13 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
-       public CreateTaxonNode(String label, IUndoContext undoContext,
-               ITaxonTreeNode parentNode, TaxonNameBase<?, ?> name, IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled);
+       public CreateTaxonNode(String label,
+               IUndoContext undoContext,
+               ITaxonTreeNode parentNode, TaxonNameBase<?, ?> name,
+               IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
 
                newTaxon = Taxon.NewInstance(name, null);
        }
@@ -71,10 +74,14 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
-       public CreateTaxonNode(String label, IUndoContext undoContext,
-               ITaxonTreeNode parentNode, Taxon taxon, IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled);
+       public CreateTaxonNode(String label,
+               IUndoContext undoContext,
+               ITaxonTreeNode parentNode,
+               Taxon taxon,
+               IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
 
                this.newTaxon = taxon;
        }
@@ -100,7 +107,7 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
 
                        return postExecute(childTaxonNode);
                }catch(Exception e){
-                       NavigationUtil.errorDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
+                       MessagingUtils.messageDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
                        return Status.CANCEL_STATUS;
                }
        }
@@ -123,7 +130,7 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
-               StoreUtil.warn(this.getClass(), "Not yet implemented.");
+               MessagingUtils.warn(this.getClass(), "Not yet implemented.");
                return null;
        }
 }