- adapted sub classes of AbstractPostOperation
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / concept / operation / CreateConceptRelationOperation.java
index a92057d3683698047b2a6219b3599507197b4ff6..40c92af92938f59b2ab03bc89f00eb4ace2bfdcd 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -30,10 +30,10 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @version 1.0
  */
 public class CreateConceptRelationOperation extends AbstractPostTaxonOperation {
-       
-       private Taxon concept;
-       private TaxonRelationshipTypeInverseContainer taxonRelationshipTypeInverseContainer;
-       
+
+       private final Taxon concept;
+       private final TaxonRelationshipTypeInverseContainer taxonRelationshipTypeInverseContainer;
+
        /**
         * <p>Constructor for CreateConceptRelationOperation.</p>
         *
@@ -51,7 +51,7 @@ public class CreateConceptRelationOperation extends AbstractPostTaxonOperation {
                this.concept = concept;
                this.taxonRelationshipTypeInverseContainer = taxonRelationshipTypeInverseContainer;
        }
-       
+
        public CreateConceptRelationOperation(String label,
                        IUndoContext undoContext, Taxon taxon, Taxon concept, TaxonRelationshipType taxonRelationshipType
                        , IPostOperationEnabled postOperationEnabled) {
@@ -69,12 +69,12 @@ public class CreateConceptRelationOperation extends AbstractPostTaxonOperation {
                monitor.worked(20);
                // add concept to taxon
                if(taxonRelationshipTypeInverseContainer.isInverse()){
-                       concept.addTaxonRelation(taxon, taxonRelationshipTypeInverseContainer.getType(), null, null);   
+                       concept.addTaxonRelation(element, taxonRelationshipTypeInverseContainer.getType(), null, null);
                } else {
-                       taxon.addTaxonRelation(concept, taxonRelationshipTypeInverseContainer.getType(), null, null);
+                   element.addTaxonRelation(concept, taxonRelationshipTypeInverseContainer.getType(), null, null);
                }
                monitor.worked(40);
-               
+
                // redraw editor if exists
                return postExecute(concept);
        }
@@ -96,9 +96,9 @@ public class CreateConceptRelationOperation extends AbstractPostTaxonOperation {
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
-               taxon.removeTaxon(concept, taxonRelationshipTypeInverseContainer.getType());
-               
+
+           element.removeTaxon(concept, taxonRelationshipTypeInverseContainer.getType());
+
                // redraw editor if exists
                return postExecute(null);
        }