import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
} else if (eventSource == selection_typeName) {
getEntity().setTypeName(selection_typeName.getEntity());
} else if (eventSource == combo_typeStatus) {
+ if (getEntity().getTypeStatus().isLectotype() && !combo_typeStatus.getSelection().isLectotype() && entity.getCitation() != null){
+ 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?");
+ if (!ok){
+ combo_typeStatus.setSelection(entity.getTypeStatus());
+ return;
+ }
+ }
getEntity().setTypeStatus(combo_typeStatus.getSelection());
+
setEntity(entity);
} else if (eventSource == checkbox_notDesignated) {
getEntity().setNotDesignated(checkbox_notDesignated.getSelection());
}
-// else if (eventSource == selection_reference) {
-// getEntity().setCitation(selection_reference.getSelection());
-// } else if (eventSource == text_referenceDetail) {
-// getEntity().setCitationMicroReference(
-// text_referenceDetail.getText());
-// }
+ else if (eventSource == selection_reference) {
+ getEntity().setCitation(selection_reference.getSelection());
+ } else if (eventSource == text_referenceDetail) {
+ getEntity().setCitationMicroReference(
+ text_referenceDetail.getText());
+ }
}
}
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
public void handleEvent(Object eventSource) {
super.handleEvent(eventSource);
if (eventSource == combo_typeStatus) {
+ if (getEntity().getTypeStatus().isLectotype() && !combo_typeStatus.getSelection().isLectotype() && entity.getCitation() != null){
+ 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?");
+ if (!ok){
+ combo_typeStatus.setSelection(entity.getTypeStatus());
+ return;
+ }
+ }
getEntity().setTypeStatus(combo_typeStatus.getSelection());
setEntity(entity);
+
}
// TODO remove this once specimens are correctly implemented
else if (eventSource == text_specimenTypeText) {
} else if (eventSource == checkbox_notDesignated) {
getEntity().setNotDesignated(checkbox_notDesignated.getSelection());
}
-// else if (eventSource == selection_reference) {
-// getEntity().setCitation(selection_reference.getSelection());
-// } else if (eventSource == text_referenceDetail) {
-// getEntity().setCitationMicroReference(
-// text_referenceDetail.getText());
-// }
+ else if (eventSource == selection_reference) {
+ getEntity().setCitation(selection_reference.getSelection());
+ } else if (eventSource == text_referenceDetail) {
+ getEntity().setCitationMicroReference(
+ text_referenceDetail.getText());
+ }
}
}