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
.occurrence
;
13 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
15 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.GatheringEventUnitElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.LayoutConstants
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
26 * GatheringEventDetailElement class.
30 * @created Jun 24, 2010
33 public class GatheringEventDetailElement
extends
34 AbstractCdmDetailElement
<DerivedUnitFacade
> {
36 private GatheringEventUnitElement element_elevation
;
38 private GatheringEventUnitElement element_distToGround
;
40 private GatheringEventUnitElement element_distToWater
;
42 private TextWithLabelElement text_collectingMethod
;
44 private TextWithLabelElement text_gatheringEventDescription
;
46 private CollectingAreasDetailSection section_collectingAreas
;
50 * Constructor for GatheringEventDetailElement.
54 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
57 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
60 public GatheringEventDetailElement(CdmFormFactory formFactory
,
61 ICdmFormElement formElement
) {
62 super(formFactory
, formElement
);
67 protected void createControls(ICdmFormElement formElement
, DerivedUnitFacade entity
, int style
) {
73 text_collectingMethod
= formFactory
.createTextWithLabelElement(formElement
, "Collecting Method", entity
.getCollectingMethod(), style
);
77 text_gatheringEventDescription
= formFactory
.createTextWithLabelElement(
78 formElement
, "Gathering Event Description", entity
.getGatheringEventDescription(), style
);
79 // element_elevation = formFactory.createGatheringEventUnitElement(
80 // formElement, "Elevation : ", entity, MinMaxTextSection.UnitType.ELEVATION, style);
83 element_distToGround
= formFactory
.createGatheringEventUnitElement(
84 formElement
, "Dist. To Ground : ", entity
, MinMaxTextSection
.UnitType
.DIST_TO_GROUND
, style
);
86 element_distToWater
= formFactory
.createGatheringEventUnitElement(
87 formElement
, "Dist. To Watersurface : ", entity
, MinMaxTextSection
.UnitType
.DIST_TO_WATER
, style
);
89 section_collectingAreas
= formFactory
.createCollectingAreasDetailSection(getConversationHolder(), formElement
, ExpandableComposite
.TWISTIE
);
90 section_collectingAreas
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2, 1));
91 section_collectingAreas
.setEntity(entity
);
97 public void handleEvent(Object eventSource
) {
98 if (eventSource
== text_collectingMethod
) {
99 getEntity().setCollectingMethod(text_collectingMethod
.getText());
100 } else if (eventSource
== text_gatheringEventDescription
) {
101 getEntity().setGatheringEventDescription(
102 text_gatheringEventDescription
.getText());