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 MinMaxTextSection section_minMaxText
;
44 private TextWithLabelElement text_collectingMethod
;
46 private TextWithLabelElement text_gatheringEventDescription
;
48 private CollectingAreasDetailSection section_collectingAreas
;
52 * Constructor for GatheringEventDetailElement.
56 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
59 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
62 public GatheringEventDetailElement(CdmFormFactory formFactory
,
63 ICdmFormElement formElement
) {
64 super(formFactory
, formElement
);
69 protected void createControls(ICdmFormElement formElement
, DerivedUnitFacade entity
, int style
) {
75 text_collectingMethod
= formFactory
.createTextWithLabelElement(formElement
, "Collecting Method", entity
.getCollectingMethod(), style
);
79 text_gatheringEventDescription
= formFactory
.createTextWithLabelElement(formElement
, "Gathering Event Description", entity
.getGatheringEventDescription(), style
);
80 element_elevation
= formFactory
.createGatheringEventUnitElement(
81 formElement
, "Elevation : ", entity
, MinMaxTextSection
.UnitType
.ELEVATION
, style
);
84 element_distToGround
= formFactory
.createGatheringEventUnitElement(
85 formElement
, "Dist. To Ground : ", entity
, MinMaxTextSection
.UnitType
.DIST_TO_GROUND
, style
);
87 element_distToWater
= formFactory
.createGatheringEventUnitElement(
88 formElement
, "Dist. To Watersurface : ", entity
, MinMaxTextSection
.UnitType
.DIST_TO_WATER
, style
);
90 section_collectingAreas
= formFactory
.createCollectingAreasDetailSection(getConversationHolder(), formElement
, ExpandableComposite
.TWISTIE
);
91 section_collectingAreas
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2, 1));
92 section_collectingAreas
.setEntity(entity
);
98 public void handleEvent(Object eventSource
) {
99 if (eventSource
== text_collectingMethod
) {
100 getEntity().setCollectingMethod(text_collectingMethod
.getText());
101 } else if (eventSource
== text_gatheringEventDescription
) {
102 getEntity().setGatheringEventDescription(
103 text_gatheringEventDescription
.getText());