Revision 15d18885
Added by Alex Theys almost 12 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateTaxonUseOperation.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.model.description.TextData; |
19 | 19 |
import eu.etaxonomy.cdm.model.media.Media; |
20 | 20 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
21 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation; |
|
21 | 22 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
22 | 23 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
23 | 24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
... | ... | |
29 | 30 |
* @created mar 13, 2012 |
30 | 31 |
* @version 1.0 |
31 | 32 |
*/ |
32 |
public class CreateTaxonUseOperation extends AbstractPostOperation {
|
|
33 |
public class CreateTaxonUseOperation extends CreateTaxonDescriptionOperation {
|
|
33 | 34 |
private TaxonDescription description; |
34 | 35 |
private Marker marker; |
35 | 36 |
|
... | ... | |
77 | 78 |
|
78 | 79 |
return postExecute(description); |
79 | 80 |
} |
80 |
|
|
81 |
/* (non-Javadoc) |
|
82 |
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
83 |
*/ |
|
84 |
/** {@inheritDoc} */ |
|
85 |
@Override |
|
86 |
public IStatus redo(IProgressMonitor monitor, IAdaptable info) |
|
87 |
throws ExecutionException { |
|
88 |
|
|
89 |
taxon.addDescription(description); |
|
90 |
|
|
91 |
return postExecute(description); |
|
92 |
} |
|
93 |
|
|
94 |
/* (non-Javadoc) |
|
95 |
* @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
96 |
*/ |
|
97 |
/** {@inheritDoc} */ |
|
98 |
@Override |
|
99 |
public IStatus undo(IProgressMonitor monitor, IAdaptable info) |
|
100 |
throws ExecutionException { |
|
101 |
|
|
102 |
taxon.removeDescription(description); |
|
103 |
|
|
104 |
return postExecute(null); |
|
105 |
} |
|
106 | 81 |
} |
107 | 82 |
|
Also available in: Unified diff
AT: committing changes to the TaxEditor Post first round of code review