Revision b0ed30f0
Added by Katja Luther about 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SpecimenTypeDesignationElement.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
19 | 19 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType; |
20 | 20 |
import eu.etaxonomy.cdm.model.term.TermType; |
21 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
21 | 22 |
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; |
22 | 23 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
23 | 24 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
... | ... | |
78 | 79 |
public void handleEvent(Object eventSource) { |
79 | 80 |
super.handleEvent(eventSource); |
80 | 81 |
if (eventSource == combo_typeStatus) { |
82 |
if (getEntity().getTypeStatus().isLectotype() && !combo_typeStatus.getSelection().isLectotype() && entity.getCitation() != null){ |
|
83 |
boolean ok = MessagingUtils.confirmDialog("Citation will be removed", "When changing the type from lectotype to a non lectotype the citation will be removed.Do you want to continue?"); |
|
84 |
if (!ok){ |
|
85 |
combo_typeStatus.setSelection(entity.getTypeStatus()); |
|
86 |
return; |
|
87 |
} |
|
88 |
} |
|
81 | 89 |
getEntity().setTypeStatus(combo_typeStatus.getSelection()); |
82 | 90 |
setEntity(entity); |
91 |
|
|
83 | 92 |
} |
84 | 93 |
// TODO remove this once specimens are correctly implemented |
85 | 94 |
else if (eventSource == text_specimenTypeText) { |
... | ... | |
96 | 105 |
} else if (eventSource == checkbox_notDesignated) { |
97 | 106 |
getEntity().setNotDesignated(checkbox_notDesignated.getSelection()); |
98 | 107 |
} |
99 |
// else if (eventSource == selection_reference) {
|
|
100 |
// getEntity().setCitation(selection_reference.getSelection());
|
|
101 |
// } else if (eventSource == text_referenceDetail) {
|
|
102 |
// getEntity().setCitationMicroReference(
|
|
103 |
// text_referenceDetail.getText());
|
|
104 |
// }
|
|
108 |
else if (eventSource == selection_reference) { |
|
109 |
getEntity().setCitation(selection_reference.getSelection()); |
|
110 |
} else if (eventSource == text_referenceDetail) { |
|
111 |
getEntity().setCitationMicroReference( |
|
112 |
text_referenceDetail.getText()); |
|
113 |
} |
|
105 | 114 |
} |
106 | 115 |
} |
Also available in: Unified diff
ref #8136: add warning message when changing type away from lectotype and citation exist