2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.reference
;
12 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
13 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
14 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
17 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
22 * NomenclaturalReferenceDetailElement class.
26 * @created Mar 12, 2010
28 public class NomenclaturalReferenceDetailElement
extends
29 AbstractCdmDetailElement
<TaxonName
> {
31 private EntitySelectionElement
<Reference
> selection_nomenclaturalReference
;
32 private TextWithLabelElement text_referenceDetail
;
36 * Constructor for NomenclaturalReferenceDetailElement.
39 * @param cdmFormFactory
40 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
43 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
48 public NomenclaturalReferenceDetailElement(CdmFormFactory cdmFormFactory
,
49 ICdmFormElement formElement
, int style
) {
50 super(cdmFormFactory
, formElement
);
55 protected void createControls(ICdmFormElement formElement
,
56 TaxonName entity
, int style
) {
57 selection_nomenclaturalReference
= formFactory
58 .createSelectionElementWithAbbreviatedTitle(Reference
.class,
59 getConversationHolder(), formElement
, "Reference",
60 (Reference
) entity
.getNomenclaturalReference(),
61 EntitySelectionElement
.ALL
, style
);
62 text_referenceDetail
= formFactory
.createTextWithLabelElement(
63 formElement
, "Reference Detail",
64 entity
.getNomenclaturalMicroReference(), style
);
69 public void handleEvent(Object eventSource
) {
70 if (eventSource
== selection_nomenclaturalReference
) {
71 getEntity().setNomenclaturalReference(
72 selection_nomenclaturalReference
.getSelection());
73 } else if (eventSource
== text_referenceDetail
) {
74 getEntity().setNomenclaturalMicroReference(
75 text_referenceDetail
.getText());