Revision 7a0547ca
Added by Patrick Plitzner over 10 years ago
- enabled DescriptiveView (Factual Data) to show descriptions of SpecimenOrObservationBase
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseSummaryOperation.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2011 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 |
*/ |
... | ... | |
14 | 14 |
import org.eclipse.core.runtime.IProgressMonitor; |
15 | 15 |
import org.eclipse.core.runtime.IStatus; |
16 | 16 |
|
17 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
|
17 | 18 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
18 | 19 |
import eu.etaxonomy.cdm.model.description.Feature; |
19 | 20 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
... | ... | |
25 | 26 |
|
26 | 27 |
/** |
27 | 28 |
* CreateUseSummaryOperation Class |
28 |
* @author a.theys
|
|
29 |
* @author a.theys |
|
29 | 30 |
* @created mar 13, 2012 |
30 | 31 |
* @version 1.0 |
31 | 32 |
*/ |
32 | 33 |
public class CreateUseSummaryOperation extends AbstractPostOperation { |
33 |
|
|
34 |
|
|
34 | 35 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.use.createUseRecord"; |
35 |
|
|
36 |
private TaxonDescription description;
|
|
37 |
private Feature feature; |
|
36 |
|
|
37 |
private final DescriptionBase<?> description;
|
|
38 |
private final Feature feature;
|
|
38 | 39 |
private DescriptionElementBase element; |
39 | 40 |
|
40 |
|
|
41 |
|
|
41 | 42 |
/** |
42 | 43 |
* <p>Constructor for CreateUseSummaryOperation.</p> |
43 | 44 |
* |
... | ... | |
48 | 49 |
* @param feature a {@link eu.etaxonomy.cdm.model.description.Feature} object. |
49 | 50 |
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object. |
50 | 51 |
*/ |
51 |
public CreateUseSummaryOperation(String label, IUndoContext undoContext, |
|
52 |
Taxon taxon, TaxonDescription description, Feature feature, IPostOperationEnabled postOperationEnabled) { |
|
53 |
super(label, undoContext, taxon, postOperationEnabled); |
|
54 |
|
|
52 |
public CreateUseSummaryOperation(String label, IUndoContext undoContext, DescriptionBase<?> description, Feature feature, IPostOperationEnabled postOperationEnabled) { |
|
53 |
super(label, undoContext, (Taxon)null, postOperationEnabled); |
|
54 |
|
|
55 | 55 |
this.description = description; |
56 | 56 |
this.feature = feature; |
57 | 57 |
} |
... | ... | |
71 | 71 |
IUndoContext undoContext, Taxon taxon, |
72 | 72 |
TaxonDescription description, Feature feature, |
73 | 73 |
DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) { |
74 |
this(label, undoContext, taxon, description, feature, postOperationEnabled);
|
|
75 |
|
|
74 |
this(label, undoContext, description, feature, postOperationEnabled); |
|
75 |
|
|
76 | 76 |
this.element = element; |
77 | 77 |
} |
78 | 78 |
|
... | ... | |
86 | 86 |
element = TextData.NewInstance(); |
87 | 87 |
} |
88 | 88 |
|
89 |
|
|
89 |
|
|
90 | 90 |
element.setFeature(feature); |
91 | 91 |
description.addElement(element); |
92 | 92 |
monitor.worked(40); |
... | ... | |
97 | 97 |
@Override |
98 | 98 |
public IStatus redo(IProgressMonitor monitor, IAdaptable info) |
99 | 99 |
throws ExecutionException { |
100 |
|
|
100 |
|
|
101 | 101 |
description.addElement(element); |
102 |
|
|
102 |
|
|
103 | 103 |
return postExecute(element); |
104 | 104 |
} |
105 | 105 |
|
... | ... | |
107 | 107 |
public IStatus undo(IProgressMonitor monitor, IAdaptable info) |
108 | 108 |
throws ExecutionException { |
109 | 109 |
description.removeElement(element); |
110 |
|
|
110 |
|
|
111 | 111 |
return postExecute(null); |
112 | 112 |
} |
113 | 113 |
} |
Also available in: Unified diff