Project

General

Profile

« Previous | Next » 

Revision 0a534d09

Added by Patrick Plitzner over 10 years ago

  • adapted sub classes of AbstractPostOperation

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/operation/DeleteConceptRelationOperation.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
31 31
 * @version 1.0
32 32
 */
33 33
public class DeleteConceptRelationOperation extends AbstractPostTaxonOperation {
34
	
35
	private Set<TaxonRelationship> taxonRelationships;	
34

  
35
	private final Set<TaxonRelationship> taxonRelationships;
36 36

  
37 37

  
38 38
	/**
......
45 45
			IUndoContext undoContext, Taxon taxon, Set<TaxonRelationship> relations,
46 46
			IPostOperationEnabled postOperationEnabled) {
47 47
		super(label, undoContext, taxon, postOperationEnabled);
48
		
48

  
49 49
		taxonRelationships = relations;
50 50
	}
51 51

  
......
56 56
	@Override
57 57
	public IStatus execute(IProgressMonitor monitor, IAdaptable info)
58 58
			throws ExecutionException {
59
		
59

  
60 60
		monitor.worked(20);
61
		
61

  
62 62
		// Remove relation from taxon
63 63
		for(TaxonRelationship relationship : taxonRelationships){
64
			taxon.removeTaxonRelation(relationship);
64
		    element.removeTaxonRelation(relationship);
65 65
			monitor.worked(10);
66 66
		}
67 67
		monitor.worked(10);
68 68

  
69
		return postExecute(taxon);
69
		return postExecute(element);
70 70
	}
71 71

  
72 72
	/* (non-Javadoc)
......
86 86
	@Override
87 87
	public IStatus undo(IProgressMonitor monitor, IAdaptable info)
88 88
			throws ExecutionException {
89
		
89

  
90 90
		for(TaxonRelationship relationship : taxonRelationships){
91
			taxon.addTaxonRelation(relationship);
91
		    element.addTaxonRelation(relationship);
92 92
			monitor.worked(10);
93 93
		}
94
		
95
		return postExecute(taxon);
94

  
95
		return postExecute(element);
96 96
	}
97 97
}

Also available in: Unified diff