3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.reference
;
13 import org
.apache
.log4j
.Logger
;
15 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
16 import eu
.etaxonomy
.cdm
.model
.reference
.INomenclaturalReference
;
17 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
18 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.forms
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.forms
.TextWithLabelElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
.SelectionType
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
23 import eu
.etaxonomy
.taxeditor
.ui
.selection
.ReferenceSelectionElement
;
26 * <p>NomenclaturalReferenceDetailElement class.</p>
29 * @created Mar 12, 2010
32 public class NomenclaturalReferenceDetailElement
extends
33 AbstractCdmDetailElement
<TaxonNameBase
> {
36 private static final Logger logger
= Logger
37 .getLogger(NomenclaturalReferenceDetailElement
.class);
38 private ReferenceSelectionElement selection_nomenclaturalReference
;
39 private TextWithLabelElement text_referenceDetail
;
42 * <p>Constructor for NomenclaturalReferenceDetailElement.</p>
44 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
45 * @param formElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
48 public NomenclaturalReferenceDetailElement(CdmFormFactory cdmFormFactory
,
49 ICdmFormElement formElement
, int style
) {
50 super(cdmFormFactory
, formElement
);
55 protected void createControls(ICdmFormElement formElement
, TaxonNameBase entity
, int style
) {
56 selection_nomenclaturalReference
= (ReferenceSelectionElement
)
57 formFactory
.createSelectionElement(SelectionType
.REFERENCE
, getConversationHolder(),
58 formElement
, "Reference", (Reference
) entity
.getNomenclaturalReference(), style
);
59 text_referenceDetail
= formFactory
.createTextWithLabelElement(formElement
, "Reference Detail", entity
.getNomenclaturalMicroReference(), style
);
64 public void handleEvent(Object eventSource
) {
65 if(eventSource
== selection_nomenclaturalReference
){
66 getEntity().setNomenclaturalReference((INomenclaturalReference
) selection_nomenclaturalReference
.getSelection());
67 }else if(eventSource
== text_referenceDetail
){
68 getEntity().setNomenclaturalMicroReference(text_referenceDetail
.getText());