import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
private GatheringEventUnitElement element_elevation;
private GatheringEventUnitElement element_distToGround;
-
+
private GatheringEventUnitElement element_distToWater;
-
+
private TextWithLabelElement text_collectingMethod;
private TextWithLabelElement text_gatheringEventDescription;
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
-
-
- // collectingArea
-
-
- text_collectingMethod = formFactory.createTextWithLabelElement(formElement, "Collecting Method", entity.getCollectingMethod(), style);
+ text_collectingMethod = formFactory.createTextWithLabelElement(formElement, "Collecting Method", entity.getCollectingMethod(), style);
- // exactLocation
text_gatheringEventDescription = formFactory.createTextWithLabelElement(
formElement, "Gathering Event Description", entity.getGatheringEventDescription(), style);
-// element_elevation = formFactory.createGatheringEventUnitElement(
-// formElement, "Elevation : ", entity, MinMaxTextSection.UnitType.ELEVATION, style);
-
-
+
element_distToGround = formFactory.createGatheringEventUnitElement(
formElement, "Dist. To Ground : ", entity, MinMaxTextSection.UnitType.DIST_TO_GROUND, style);
-
+
element_distToWater = formFactory.createGatheringEventUnitElement(
formElement, "Dist. To Watersurface : ", entity, MinMaxTextSection.UnitType.DIST_TO_WATER, style);
-
- section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
- section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- section_collectingAreas.setEntity(entity);
+
+
+ if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION)){
+ section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_collectingAreas.setEntity(entity);
+ }
}