Revision cd024235
Added by Katja Luther over 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java | ||
---|---|---|
25 | 25 |
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement; |
26 | 26 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
27 | 27 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
28 |
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator; |
|
28 | 29 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
29 | 30 |
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement; |
30 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
|
31 |
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractSingleSourceElement;
|
|
31 | 32 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
32 | 33 |
|
33 | 34 |
/** |
... | ... | |
35 | 36 |
* @date Dec 1, 2011 |
36 | 37 |
* |
37 | 38 |
*/ |
38 |
public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<TaxonRelationship> {
|
|
39 |
public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<TaxonRelationship> {//TODO: use AbstractSingleSourcedElement
|
|
39 | 40 |
|
40 | 41 |
private TermComboElement<TaxonRelationshipTypeInverseContainer> combo_taxonRelationshipType; |
41 | 42 |
private MisappliedRelationshipComboElement combo_misappliedRelationshipType; |
... | ... | |
43 | 44 |
private EntitySelectionElement<Taxon> selection_relatedTaxon; |
44 | 45 |
private CheckboxElement checkBoxDoubtful; |
45 | 46 |
protected ToggleableTextElement toggleable_cache; |
46 |
private EntitySelectionElement<Reference> secReference; |
|
47 |
// private EntitySelectionElement<Reference> secReference;
|
|
47 | 48 |
private EntitySelectionElement<Reference> sensuReference; |
48 | 49 |
private TextWithLabelElement text_sensu_microreference; |
49 | 50 |
|
50 | 51 |
|
51 |
private TextWithLabelElement text_secundum_microreference; |
|
52 |
// private TextWithLabelElement text_secundum_microreference;
|
|
52 | 53 |
|
53 | 54 |
private TextWithLabelElement text_appendedPhrase; |
54 | 55 |
|
55 | 56 |
private CheckboxElement checkbox_published; |
56 | 57 |
|
57 |
|
|
58 | 58 |
private Taxon taxon; |
59 | 59 |
|
60 | 60 |
private TaxonDetailSection taxonElement; |
... | ... | |
65 | 65 |
|
66 | 66 |
public TaxonRelationshipDetailElement(CdmFormFactory formFactory, |
67 | 67 |
ICdmFormElement formElement) { |
68 |
|
|
68 | 69 |
super(formFactory, formElement); |
69 | 70 |
} |
70 | 71 |
|
71 | 72 |
@Override |
72 |
protected void createControls(ICdmFormElement formElement,
|
|
73 |
public void createControls(ICdmFormElement formElement,
|
|
73 | 74 |
TaxonRelationship entity, int style) { |
74 | 75 |
if ((entity.getType().isMisappliedNameOrInvalidDesignation()) ){ |
75 | 76 |
|
... | ... | |
119 | 120 |
}else{ |
120 | 121 |
label = "Err. Sec."; |
121 | 122 |
} |
123 |
|
|
124 |
/*TODO: use super.createControls(); to create single source element |
|
122 | 125 |
secReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(), |
123 | 126 |
formElement, label, |
124 | 127 |
entity.getCitation(), EntitySelectionElement.ALL, |
... | ... | |
128 | 131 |
formElement, "Detail", |
129 | 132 |
entity.getCitationMicroReference(),null, |
130 | 133 |
SWT.WRAP); |
134 |
*/ |
|
135 |
super.createControls(formElement, entity, style); |
|
136 |
setSourceLabel(label); |
|
137 |
|
|
131 | 138 |
if (entity.getType().isAnyMisappliedName()) { |
132 | 139 |
label = "Misapplication Doubtful"; |
133 | 140 |
}else{ |
... | ... | |
149 | 156 |
|
150 | 157 |
checkbox_published = formFactory.createCheckbox(this, |
151 | 158 |
"Published", taxon.isPublish(), style); |
152 |
secReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(), |
|
159 |
/* |
|
160 |
* secReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(), |
|
161 |
|
|
153 | 162 |
formElement, "Syn. Sec.", |
154 | 163 |
entity.getCitation(), EntitySelectionElement.ALL, |
155 | 164 |
style); |
... | ... | |
158 | 167 |
formElement, "Detail", |
159 | 168 |
entity.getCitationMicroReference(),null, |
160 | 169 |
SWT.WRAP); |
170 |
*/ |
|
171 |
|
|
172 |
super.createControls(formElement, entity, style); |
|
173 |
setSourceLabel("Syn. Sec."); |
|
161 | 174 |
sensuReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(), |
162 | 175 |
formElement, "Sec", |
163 | 176 |
taxon.getSec(), EntitySelectionElement.ALL, |
... | ... | |
207 | 220 |
@Override |
208 | 221 |
public void handleEvent(Object eventSource) { |
209 | 222 |
if (getEntity().getType().isMisappliedNameOrInvalidDesignation() || getEntity().getType().isAnySynonym()){ |
210 |
if (eventSource == secReference) { |
|
223 |
/* if (eventSource == secReference) {
|
|
211 | 224 |
getEntity().setCitation(secReference.getSelection()); |
212 | 225 |
} else if (eventSource == text_secundum_microreference) { |
213 | 226 |
getEntity().setCitationMicroReference(text_secundum_microreference.getText()); |
214 |
} else if (eventSource == text_sensu_microreference) { |
|
227 |
} else |
|
228 |
*/ |
|
229 |
if (eventSource == text_sensu_microreference) { |
|
215 | 230 |
taxon.setSecMicroReference(text_sensu_microreference.getText()); |
216 | 231 |
} else if (eventSource == sensuReference) { |
217 | 232 |
taxon.setSec(sensuReference.getSelection()); |
... | ... | |
272 | 287 |
|
273 | 288 |
} |
274 | 289 |
|
290 |
@Override |
|
291 |
public SelectionArbitrator getSelectionArbitrator() { |
|
292 |
// TODO Auto-generated method stub |
|
293 |
return null; |
|
294 |
} |
|
295 |
|
|
275 | 296 |
|
276 | 297 |
|
277 | 298 |
} |
Also available in: Unified diff
ref #9199: adapt nomenclatural status to original source and layout issues