- adapted sub classes of AbstractPostOperation
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / name / operation / ChangeConceptRelationshipTypeOperation.java
index ef6b021c66ef9d4353e260b4e775a697a98c298a..850747b6252772404bb0d6cfbb7f5145d9914067 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.
 */
@@ -32,13 +32,13 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOperation {
-       
+
        private Taxon relatedTaxon;
-       
+
        private TaxonRelationship taxonRelationship;
-       
+
        private TaxonRelationshipType oldRelationshipType;
-       
+
        private TaxonRelationshipType newRelationshipType;
 
        /**
@@ -55,20 +55,20 @@ public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOpe
                        IUndoContext undoContext, Taxon taxon, Taxon relatedTaxon, TaxonRelationshipType type, IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, taxon, postOperationEnabled);
                this.relatedTaxon = relatedTaxon;
-                               
+
                Set<TaxonRelationship> taxonRelationships = taxon.getTaxonRelations(relatedTaxon);
-               
+
                if(taxonRelationships.size() > 1){
                        StoreUtil.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
                                        "accepted and the related taxon. This case is not handled by the software yet");
                        return;
                }
-               
+
                this.taxonRelationship = taxonRelationships.iterator().next();
                this.oldRelationshipType = taxonRelationship.getType();
                this.newRelationshipType = type;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
@@ -76,17 +76,17 @@ public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOpe
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
+
                // Remove relatedTaxon and old relationship
                // FIXME since taxon relationships come in a set, which relationships are we going to delete here?
-               taxon.removeTaxon(relatedTaxon, oldRelationshipType);
+           element.removeTaxon(relatedTaxon, oldRelationshipType);
                monitor.worked(20);
-        
+
         // Add new relationship
                // TODO add microcitation for misapplied name to property sheet
-               relatedTaxon.addTaxonRelation(taxon, newRelationshipType, null, null);  
+               relatedTaxon.addTaxonRelation(element, newRelationshipType, null, null);
                monitor.worked(40);
-               
+
                return postExecute(relatedTaxon);
        }