From e42715bae7a0e61c038c4b2740b64e5be20cc7e7 Mon Sep 17 00:00:00 2001 From: Patric Plitzner
Constructor for FieldObservationDetailSection.
+ * + * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object. + * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. + * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object. + * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object. + * @param style a int. + */ + public FieldObservationDetailsSection(CdmFormFactory formFactory, ConversationHolder conversation, + ICdmFormElement parentElement, + ISelectionProvider selectionProvider, int style) { + super(formFactory, conversation, parentElement, selectionProvider, style); + } + + /** {@inheritDoc} */ + @Override + public String getHeading() { + return "Field Observation Details"; + } + + /* (non-Javadoc) + * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int) + */ + @Override + protected AbstractCdmDetailElementConstructor for FieldObservationDetailSection.
@@ -35,7 +35,7 @@ public class FieldObservationSection extends AbstractCdmDetailSection
@@ -64,18 +60,18 @@ public class GatheringEventDetailsElementController extends AbstractCdmDetailEle
/** {@inheritDoc} */
@Override
- protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ protected void createControls(ICdmFormElement formElement, FieldUnit entity, int style) {
// number_absoluteElevationError = new NumberFieldController(gatheringEventDetailsElement.getTextElevationError(), formFactory, this, entity.getAbsoluteElevation());
// number_absoluteElevationMinimum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMinimum(), formFactory, this, entity.getAbsoluteElevationMinimum());
- number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, entity.getAbsoluteElevationMaximum());
- text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, entity.getCollectingMethod(), null);
- number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, entity.getDistanceToGround());
- number_distanceToWaterSurface = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToWaterSurface(), formFactory, this, entity.getDistanceToWaterSurface());
- text_gatheringEventDescription = new TextFieldController(gatheringEventDetailsElement.getText_GatheringEventDescription(), formFactory, this, entity.getGatheringEventDescription(), null);
- section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
- section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- section_collectingAreas.setEntity(entity);
+ number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, entity.getGatheringEvent().getAbsoluteElevationMax());
+ text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, entity.getGatheringEvent().getCollectingMethod(), null);
+ number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, entity.getGatheringEvent().getDistanceToGround());
+ number_distanceToWaterSurface = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToWaterSurface(), formFactory, this, entity.getGatheringEvent().getDistanceToWaterSurface());
+ text_gatheringEventDescription = new TextFieldController(gatheringEventDetailsElement.getText_GatheringEventDescription(), formFactory, this, entity.getGatheringEvent().getDescription(), null);
+// section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+// section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+// section_collectingAreas.setEntity(entity);
}
/** {@inheritDoc} */
@@ -103,13 +99,13 @@ public class GatheringEventDetailsElementController extends AbstractCdmDetailEle
// }
// } else
if (eventSource == text_collectingMethod) {
- getEntity().setCollectingMethod(text_collectingMethod.getText());
+ getEntity().getGatheringEvent().setCollectingMethod(text_collectingMethod.getText());
} else if (eventSource == number_distanceToGround) {
- getEntity().setDistanceToGround(number_distanceToGround.getDouble());
+ getEntity().getGatheringEvent().setDistanceToGround(number_distanceToGround.getDouble());
} else if (eventSource == number_distanceToWaterSurface) {
- getEntity().setDistanceToWaterSurface(number_distanceToWaterSurface.getDouble());
+ getEntity().getGatheringEvent().setDistanceToWaterSurface(number_distanceToWaterSurface.getDouble());
} else if (eventSource == text_gatheringEventDescription) {
- getEntity().setGatheringEventDescription(text_gatheringEventDescription.getText());
+ getEntity().getGatheringEvent().setDescription(text_gatheringEventDescription.getText());
}
}
}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventSection.java
new file mode 100644
index 000000000..e9c71c9ff
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventSection.java
@@ -0,0 +1,61 @@
+// $Id$
+/**
+* Copyright (C) 2013 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
+
+/**
+ * @author pplitzner
+ * @date 21.08.2013
+ *
+ */
+public class GatheringEventSection extends AbstractCdmDetailSection Constructor for GatheringEventDetailSection.