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
.model
.AbstractUtility
;
17 import eu
.etaxonomy
.taxeditor
.preference
.Resources
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.GatheringEventUnitElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.LayoutConstants
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
;
23 import eu
.etaxonomy
.taxeditor
.ui
.element
.NumberWithLabelElement
;
24 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
25 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
29 * GatheringEventDetailElement class.
33 * @created Jun 24, 2010
36 public class GatheringEventDetailElement
extends
37 AbstractCdmDetailElement
<DerivedUnitFacade
> {
39 private GatheringEventUnitElement element_elevation
;
41 private GatheringEventUnitElement element_distToGround
;
43 private GatheringEventUnitElement element_distToWater
;
45 private MinMaxTextSection section_minMaxText
;
47 private TextWithLabelElement text_collectingMethod
;
49 private TextWithLabelElement text_gatheringEventDescription
;
51 private CollectingAreasDetailSection section_collectingAreas
;
55 * Constructor for GatheringEventDetailElement.
59 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
62 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
65 public GatheringEventDetailElement(CdmFormFactory formFactory
,
66 ICdmFormElement formElement
) {
67 super(formFactory
, formElement
);
72 protected void createControls(ICdmFormElement formElement
, DerivedUnitFacade entity
, int style
) {
78 text_collectingMethod
= formFactory
.createTextWithLabelElement(formElement
, "Collecting Method", entity
.getCollectingMethod(), style
);
82 text_gatheringEventDescription
= formFactory
.createTextWithLabelElement(formElement
, "Gathering Event Description", entity
.getGatheringEventDescription(), style
);
83 element_elevation
= formFactory
.createGatheringEventUnitElement(
84 formElement
, "Elevation : ", entity
, MinMaxTextSection
.UnitType
.ELEVATION
, style
);
87 element_distToGround
= formFactory
.createGatheringEventUnitElement(
88 formElement
, "Dist. To Ground : ", entity
, MinMaxTextSection
.UnitType
.DIST_TO_GROUND
, style
);
90 element_distToWater
= formFactory
.createGatheringEventUnitElement(
91 formElement
, "Dist. To Water : ", entity
, MinMaxTextSection
.UnitType
.DIST_TO_WATER
, style
);
93 section_collectingAreas
= formFactory
.createCollectingAreasDetailSection(getConversationHolder(), formElement
, ExpandableComposite
.TWISTIE
);
94 section_collectingAreas
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2, 1));
95 section_collectingAreas
.setEntity(entity
);
101 public void handleEvent(Object eventSource
) {
102 if (eventSource
== text_collectingMethod
) {
103 getEntity().setCollectingMethod(text_collectingMethod
.getText());
104 } else if (eventSource
== text_gatheringEventDescription
) {
105 getEntity().setGatheringEventDescription(
106 text_gatheringEventDescription
.getText());