1 |
1 |
// $Id$
|
2 |
2 |
/**
|
3 |
3 |
* Copyright (C) 2007 EDIT
|
4 |
|
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy
|
5 |
5 |
* http://www.e-taxonomy.eu
|
6 |
|
*
|
|
6 |
*
|
7 |
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8 |
8 |
* See LICENSE.TXT at the top of this package for the full license terms.
|
9 |
9 |
*/
|
... | ... | |
15 |
15 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
|
16 |
16 |
import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
|
17 |
17 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
18 |
|
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
|
19 |
18 |
import eu.etaxonomy.taxeditor.model.AbstractUtility;
|
20 |
19 |
import eu.etaxonomy.taxeditor.store.CdmStore;
|
21 |
20 |
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
|
22 |
|
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
|
23 |
21 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
24 |
22 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
|
25 |
23 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
|
... | ... | |
30 |
28 |
* <p>
|
31 |
29 |
* DerivedUnitBaseDetailElement class.
|
32 |
30 |
* </p>
|
33 |
|
*
|
|
31 |
*
|
34 |
32 |
* @author n.hoffmann
|
35 |
33 |
* @created Jun 24, 2010
|
36 |
34 |
* @version 1.0
|
... | ... | |
47 |
45 |
private EntitySelectionElement<TaxonNameBase> selection_storedUnder;
|
48 |
46 |
|
49 |
47 |
private TextWithLabelElement text_exsicatum;
|
50 |
|
|
51 |
|
|
52 |
|
private TermComboElement<PreservationMethod> combo_preservationMethod;
|
|
48 |
|
|
49 |
//FIXME:3.3MC----
|
|
50 |
// private TermComboElement<PreservationMethod> combo_preservationMethod;
|
|
51 |
//FIXME:3.3MC----
|
53 |
52 |
|
54 |
53 |
private SpecimenCollectionDetailSection section_duplicates;
|
55 |
54 |
|
... | ... | |
59 |
58 |
* <p>
|
60 |
59 |
* Constructor for DerivedUnitBaseDetailElement.
|
61 |
60 |
* </p>
|
62 |
|
*
|
|
61 |
*
|
63 |
62 |
* @param formFactory
|
64 |
63 |
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
|
65 |
64 |
* object.
|
... | ... | |
84 |
83 |
text_barcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
|
85 |
84 |
text_catalogNumber = formFactory.createTextWithLabelElement(formElement, "Catalog Number", entity.getCatalogNumber(), style);
|
86 |
85 |
|
87 |
|
|
88 |
|
try {
|
89 |
|
combo_preservationMethod = formFactory.createTermComboElement(PreservationMethod.class, formElement, "Preservation Method", entity.getPreservationMethod(), style);
|
90 |
|
} catch (MethodNotSupportedByDerivedUnitTypeException e) {
|
91 |
|
// we ignore this
|
92 |
|
AbstractUtility.info(e.getMessage());
|
93 |
|
}
|
|
86 |
//FIXME:3.3MC----
|
|
87 |
// try {
|
|
88 |
// combo_preservationMethod = formFactory.createTermComboElement(PreservationMethod.class, formElement, "Preservation Method", entity.getPreservationMethod(), style);
|
|
89 |
// } catch (MethodNotSupportedByDerivedUnitTypeException e) {
|
|
90 |
// // we ignore this
|
|
91 |
// AbstractUtility.info(e.getMessage());
|
|
92 |
// }
|
|
93 |
//FIXME:3.3MC----
|
94 |
94 |
selection_storedUnder = formFactory.createSelectionElement(TaxonNameBase.class, getConversationHolder(), formElement, "Stored Under", entity.getStoredUnder(), EntitySelectionElement.ALL, style);
|
95 |
95 |
|
96 |
96 |
try {
|
... | ... | |
124 |
124 |
getEntity().setBarcode(text_barcode.getText());
|
125 |
125 |
} else if (eventSource == text_catalogNumber) {
|
126 |
126 |
getEntity().setCatalogNumber(text_catalogNumber.getText());
|
127 |
|
} else if (eventSource == combo_preservationMethod) {
|
128 |
|
try {
|
129 |
|
getEntity().setPreservationMethod(
|
130 |
|
combo_preservationMethod.getSelection());
|
131 |
|
} catch (MethodNotSupportedByDerivedUnitTypeException e) {
|
132 |
|
AbstractUtility
|
133 |
|
.errorDialog(
|
134 |
|
"MethodNotSupportedByDerivedUnitTypeException",
|
135 |
|
this,
|
136 |
|
"MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit",
|
137 |
|
e);
|
138 |
|
}
|
|
127 |
//FIXME:3.3MC----
|
|
128 |
// } else if (eventSource == combo_preservationMethod) {
|
|
129 |
// try {
|
|
130 |
// getEntity().setPreservationMethod(
|
|
131 |
// combo_preservationMethod.getSelection());
|
|
132 |
// } catch (MethodNotSupportedByDerivedUnitTypeException e) {
|
|
133 |
// AbstractUtility
|
|
134 |
// .errorDialog(
|
|
135 |
// "MethodNotSupportedByDerivedUnitTypeException",
|
|
136 |
// this,
|
|
137 |
// "MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit",
|
|
138 |
// e);
|
|
139 |
// }
|
|
140 |
//FIXME:3.3MC----
|
139 |
141 |
} else if (eventSource == selection_storedUnder) {
|
140 |
142 |
getEntity().setStoredUnder(selection_storedUnder.getEntity());
|
141 |
143 |
} else if (eventSource == text_exsicatum) {
|