package eu.etaxonomy.taxeditor.ui.section.occurrence;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.model.agent.AgentBase;
-import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.occurrence.Collection;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
-import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection;
-import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.PointElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
AbstractCdmDetailElement<DerivedUnitFacade> {
private ToggleableTextElement toggleableText_titleCache;
- private EnumComboElement<SpecimenOrObservationType> combo_specorobstype;
- private EntitySelectionElement<NamedArea> selection_country;
- private LanguageStringWithLabelElement languageText_locality;
- private PointElement element_point;
- private NumberWithLabelElement number_elevation;
- private TimePeriodElement element_date;
- private EntitySelectionElement<AgentBase> selection_collector;
- private TextWithLabelElement text_collectingNumber;
private EntitySelectionElement<Collection> selection_collection;
private TextWithLabelElement text_accessionNumber;
- private GatheringEventUnitElement element_elevation;
toggleableText_titleCache = formFactory.createToggleableTextField(
formElement, "Title Cache", entity.getTitleCache(),
entity.isProtectedTitleCache(), style);
-
- combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement, style);
- combo_specorobstype.setSelection(entity.getType());
- selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(),
- formElement, "Country",
- entity.getCountry(), EntitySelectionElement.NOTHING, style);
- languageText_locality = formFactory
- .createLanguageStringWithLabelElement(formElement, "Locality",
- entity.getLocality(), style);
- element_point = formFactory.createPointElement(formElement,
- entity.getExactLocation(), style);
- element_elevation = formFactory.createGatheringEventUnitElement(
- formElement, "Elevation : ", entity, MinMaxTextSection.UnitType.ELEVATION, style);
-
- element_date = formFactory.createTimePeriodElement(formElement, "Date",
- entity.getGatheringPeriod(), style);
- selection_collector = formFactory
- .createSelectionElement(AgentBase.class,
- getConversationHolder(), formElement, "Collector",
- entity.getCollector(), EntitySelectionElement.ALL,
- style);
- text_collectingNumber = formFactory.createTextWithLabelElement(formElement,
- "Collecting number", entity.getFieldNumber(), style);
+ toggleableText_titleCache.setEnabled(false);
selection_collection = formFactory
.createSelectionElement(Collection.class,
getConversationHolder(), formElement, "Collection",
*/
@Override
public void handleEvent(Object eventSource) {
- if (eventSource == toggleableText_titleCache) {
- getEntity().setTitleCache(toggleableText_titleCache.getText(),
- toggleableText_titleCache.getState());
- } else if (eventSource == selection_country) {
- getEntity().setCountry(selection_country.getSelection());
- } else if (eventSource == languageText_locality) {
- LanguageString locality = languageText_locality.getLanguageString();
- getEntity().setLocality(locality);
- } else if (eventSource == element_point) {
- getEntity().setExactLocation(element_point.getPoint());
- } else if (eventSource == number_elevation) {
- getEntity().setAbsoluteElevation(number_elevation.getInteger());
- } else if (eventSource == element_date) {
- getEntity().setGatheringPeriod(element_date.getTimePeriod());
- } else if (eventSource == selection_collector) {
- getEntity().setCollector(selection_collector.getSelection());
- } else if (eventSource == text_collectingNumber) {
- getEntity().setFieldNumber(text_collectingNumber.getText());
- }
- else if (eventSource == selection_collection) {
- getEntity().setCollection(selection_collection.getSelection());
- } else if (eventSource == text_accessionNumber) {
- getEntity().setAccessionNumber(text_accessionNumber.getText());
- } else if (eventSource == combo_specorobstype) {
- getEntity().setType(combo_specorobstype.getSelection());
- }
-
- if (eventSource != toggleableText_titleCache) {
- toggleableText_titleCache.setText(getEntity().getTitleCache());
- }
+ if (eventSource == toggleableText_titleCache) {
+ getEntity().setTitleCache(toggleableText_titleCache.getText(),
+ toggleableText_titleCache.getState());
+ }
+ else if (eventSource == selection_collection) {
+ getEntity().setCollection(selection_collection.getSelection());
+ } else if (eventSource == text_accessionNumber) {
+ getEntity().setAccessionNumber(text_accessionNumber.getText());
+ }
+ if (eventSource != toggleableText_titleCache) {
+ toggleableText_titleCache.setText(getEntity().getTitleCache());
+ }
}
}
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.PointElement;
private ToggleableTextElement toggleableText_titleCache;
private EnumComboElement<SpecimenOrObservationType> combo_specorobstype;
private EntitySelectionElement<NamedArea> selection_country;
+ private CollectingAreasDetailSection section_collectingAreas;
private LanguageStringWithLabelElement languageText_locality;
private PointElement element_point;
private NumberWithLabelElement number_elevation;
combo_specorobstype.setSelection(entity.getType());
selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(), formElement,
"Country", entity.getCountry(), EntitySelectionElement.NOTHING, style);
+
+ section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_collectingAreas.setEntity(entity);
+
languageText_locality = formFactory.createLanguageStringWithLabelElement(formElement, "Locality",
entity.getLocality(), style);
element_point = formFactory.createPointElement(formElement, entity.getExactLocation(), style);
package eu.etaxonomy.taxeditor.ui.section.occurrence;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
private GatheringEventUnitElement element_elevation;
private GatheringEventUnitElement element_distToGround;
-
+
private GatheringEventUnitElement element_distToWater;
-
+
private TextWithLabelElement text_collectingMethod;
private TextWithLabelElement text_gatheringEventDescription;
- private CollectingAreasDetailSection section_collectingAreas;
-
/**
* <p>
* Constructor for GatheringEventDetailElement.
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
-
-
- // collectingArea
-
-
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);
}