Revision 37811f53
Added by Katja Luther over 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java | ||
---|---|---|
22 | 22 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
23 | 23 |
|
24 | 24 |
import eu.etaxonomy.cdm.model.media.ExternalLinkType; |
25 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
|
25 | 26 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
26 | 27 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCodeEdition; |
28 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
27 | 29 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType; |
28 | 30 |
import eu.etaxonomy.cdm.model.reference.OriginalSourceType; |
29 | 31 |
import eu.etaxonomy.cdm.model.reference.ReferenceType; |
... | ... | |
32 | 34 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
33 | 35 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
34 | 36 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
37 |
import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailElement; |
|
38 |
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusElement; |
|
39 |
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection; |
|
35 | 40 |
|
36 | 41 |
/** |
37 | 42 |
* @author n.hoffmann |
... | ... | |
214 | 219 |
elementTypeList.add(keyLabelPair.getKey()); |
215 | 220 |
combo.add(keyLabelPair.getValue()); |
216 | 221 |
} |
222 |
}else if(enumType.equals(NomenclaturalCodeEdition.class)){ |
|
223 |
NomenclaturalCode code = null; |
|
224 |
|
|
225 |
ICdmFormElement parentElement = getParentElement(); |
|
226 |
if (parentElement instanceof NameRelationshipDetailElement){ |
|
227 |
NameRelationship rel = ((NameRelationshipDetailElement)parentElement).getEntity(); |
|
228 |
code = rel.getToName().getNomenclaturalCode(); |
|
229 |
}else if (parentElement instanceof NomenclaturalStatusElement){ |
|
230 |
ICdmFormElement parent = ((NomenclaturalStatusElement)parentElement).getParentElement(); |
|
231 |
TaxonName name = ((NomenclaturalStatusSection)parent).getEntity(); |
|
232 |
code = name.getNomenclaturalCode(); |
|
233 |
} |
|
234 |
List<NomenclaturalCodeEdition> elements = NomenclaturalCodeEdition.forCode(code); |
|
235 |
LinkedHashMap<NomenclaturalCodeEdition, String> orderedTerms = AbstractUtility.orderTerms(elements); |
|
236 |
for (NomenclaturalCodeEdition codeEdition: elements){ |
|
237 |
elementTypeList.add((T)codeEdition); |
|
238 |
combo.add(codeEdition.getMessage()); |
|
239 |
} |
|
217 | 240 |
} |
218 | 241 |
// default order |
219 | 242 |
else{ |
Also available in: Unified diff
ref #8410: add only nomenclatural code editions for code of name to combo