/**
* 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.
*/
* @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>
*
this.concept = concept;
this.taxonRelationshipTypeInverseContainer = taxonRelationshipTypeInverseContainer;
}
-
+
public CreateConceptRelationOperation(String label,
IUndoContext undoContext, Taxon taxon, Taxon concept, TaxonRelationshipType taxonRelationshipType
, IPostOperationEnabled postOperationEnabled) {
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);
}
@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);
}