ref #6909 Migrate remote handler
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / operation / CreateClassification.java
index 12c9d5548fad1aba909026ac100cb3f967e8c926..107b311faa6ae5545454baa70d75dff1429b1658 100644 (file)
@@ -1,9 +1,8 @@
-// $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -23,6 +22,7 @@ import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -35,8 +35,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 @Deprecated // we do not undo creation of elements
 public class CreateClassification extends AbstractPersistentPostOperation {
 
-       private Classification classification;
-       
+       private final Classification classification;
+
        /**
         * <p>Constructor for SaveClassificationOperation.</p>
         *
@@ -48,39 +48,34 @@ public class CreateClassification extends AbstractPersistentPostOperation {
         */
        public CreateClassification(String label, IUndoContext undoContext, Classification classification,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
-               
+                       IConversationEnabled conversationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitiySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitiySessionEnabled);
+
                this.classification = classification;
-               
+
        }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
+
        /** {@inheritDoc} */
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
                bind();
                monitor.worked(20);
-               
+
                if(classification.getReference() == null){
                        Reference reference = ReferenceFactory.newGeneric();
-                       reference.setTitleCache(classification.getTitleCache());
+                       reference.setTitle(classification.getTitleCache());
                        classification.setReference(reference);
                }
-               
+
                CdmStore.getService(IClassificationService.class).saveOrUpdate(classification);
-               
+
                monitor.worked(40);
 
                return postExecute(classification);
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        /** {@inheritDoc} */
        @Override
        public IStatus redo(IProgressMonitor monitor, IAdaptable info)
@@ -88,9 +83,6 @@ public class CreateClassification extends AbstractPersistentPostOperation {
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        /** {@inheritDoc} */
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)