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
.description
.detail
;
12 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
13 import eu
.etaxonomy
.cdm
.model
.description
.PresenceAbsenceTerm
;
14 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
15 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
21 * <p>DistributionDetailElement class.</p>
24 * @created Jun 10, 2010
27 public class DistributionDetailElement
extends
28 AbstractDetailedDescriptionDetailElement
<Distribution
> {
30 private EntitySelectionElement
<NamedArea
> selection_namedArea
;
31 private TermComboElement
<PresenceAbsenceTerm
> combo_presenceAbsence
;
35 * <p>Constructor for DistributionDetailElement.</p>
37 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
38 * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
39 * @param entity a {@link eu.etaxonomy.cdm.model.description.Distribution} object.
42 public DistributionDetailElement(CdmFormFactory formFactory
,
43 ICdmFormElement formElement
, Distribution entity
, int style
) {
44 super(formFactory
, formElement
, entity
, style
);
49 protected void createControls(ICdmFormElement formElement
,
50 Distribution entity
, int style
) {
51 selection_namedArea
= formFactory
.createSelectionElement(NamedArea
.class, getConversationHolder(),
53 entity
.getArea(), EntitySelectionElement
.NOTHING
, style
);
54 combo_presenceAbsence
= formFactory
.createTermComboElement(PresenceAbsenceTerm
.class, this, "Distribution Status", entity
.getStatus(), style
);
60 public void handleEvent(Object eventSource
) {
61 if(eventSource
== selection_namedArea
){
62 getEntity().setArea(selection_namedArea
.getEntity());
63 }else if(eventSource
== combo_presenceAbsence
){
64 getEntity().setStatus(combo_presenceAbsence
.getSelection());