eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/compatibility/IEntitySelectionElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsElementController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsView.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralElementController.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElementController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenGeneralElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenGeneralElementController.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenSection.java -text
*/
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
* @date 15.08.2013
*
*/
-public class FieldObservationDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+public class FieldObservationDetailsElementController extends AbstractCdmDetailElement<FieldUnit> {
private FieldObservationDetailsElement fieldObservationDetailsElement;
/** {@inheritDoc} */
@Override
- protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
- text_ecology = new TextFieldController(fieldObservationDetailsElement.getText_ecology(), getFormFactory(), formElement, entity.getEcology(CdmStore.getDefaultLanguage()), null);
- text_plantDescription = new TextFieldController(fieldObservationDetailsElement.getText_plantDescription(), getFormFactory(), formElement, entity.getPlantDescription(CdmStore.getDefaultLanguage()), style);
+ protected void createControls(ICdmFormElement formElement, FieldUnit entity, int style) {
+// text_ecology = new TextFieldController(fieldObservationDetailsElement.getText_ecology(), getFormFactory(), formElement, entity.getEcology(CdmStore.getDefaultLanguage()), null);
+// text_plantDescription = new TextFieldController(fieldObservationDetailsElement.getText_plantDescription(), getFormFactory(), formElement, entity.getPlantDescription(CdmStore.getDefaultLanguage()), style);
// Disable for now
// text_fieldObjectDefinition = formFactory.createTextWithLabelElement(formElement, "Field Object Definition", entity.getFieldObjectDefinition(CdmStore.getDefaultLanguage()), style);
text_fieldNotes = new TextFieldController(fieldObservationDetailsElement.getText_FieldNotes(), getFormFactory(), formElement, entity.getFieldNotes(), style);
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
- if (eventSource == text_ecology) {
- getEntity().setEcology(text_ecology.getText());
- } else if (eventSource == text_plantDescription) {
- getEntity().setPlantDescription(text_plantDescription.getText());
- } else if (eventSource == text_fieldObjectDefinition) {
- getEntity().addFieldObjectDefinition(text_fieldObjectDefinition.getText(), CdmStore.getDefaultLanguage());
- } else if (eventSource == text_fieldNotes) {
+// if (eventSource == text_ecology) {
+// getEntity().setEcology(text_ecology.getText());
+// } else if (eventSource == text_plantDescription) {
+// getEntity().setPlantDescription(text_plantDescription.getText());
+// } else if (eventSource == text_fieldObjectDefinition) {
+// getEntity().addFieldObjectDefinition(text_fieldObjectDefinition.getText(), CdmStore.getDefaultLanguage());
+// } else
+ if (eventSource == text_fieldNotes) {
getEntity().setFieldNotes(text_fieldNotes.getText());
} else if (eventSource == number_individualCount) {
getEntity().setIndividualCount(number_individualCount.getInteger());
--- /dev/null
+// $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 FieldObservationDetailsSection extends AbstractCdmDetailSection<FieldUnit> implements IDerivedUnitFacadeDetailSection{
+
+ /**
+ * <p>Constructor for FieldObservationDetailSection.</p>
+ *
+ * @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 AbstractCdmDetailElement<FieldUnit> createCdmDetailElement(AbstractCdmDetailSection<FieldUnit> parentElement, int style) {
+ return formFactory.createFieldObservationDetailsElementController(parentElement);
+ }
+}
*/
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
-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.FieldUnit;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.LanguageTextFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
* @date 13.08.2013
*
*/
-public class FieldObservationGeneralElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+public class FieldObservationGeneralElementController extends AbstractCdmDetailElement<FieldUnit> {
private FieldObservationGeneralElement fieldObservationGeneralElement;
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
*/
@Override
- protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ protected void createControls(ICdmFormElement formElement, FieldUnit entity, int style) {
toggleableText_titleCache = new ToggleableTextFieldController(fieldObservationGeneralElement.getToggleableTextField(), getFormFactory(), formElement, entity.getTitleCache(), entity.isProtectedTitleCache(), style);
- selection_country = new EntitySelectionFieldController<NamedArea>(fieldObservationGeneralElement.getCountrySelectionField(), getFormFactory(), getConversationHolder(), formElement, NamedArea.class, entity.getCountry(), EntitySelectionElement.NOTHING);
- languageText_locality = new LanguageTextFieldController(fieldObservationGeneralElement.getTextLocality(), getFormFactory(), formElement, entity.getLocality());
- element_point = new PointFieldController(fieldObservationGeneralElement.getPointField(),getFormFactory(), formElement, entity.getExactLocation(), style);
- number_elevation = new NumberFieldController(fieldObservationGeneralElement.getTextElevation(), getFormFactory(), formElement, entity.getAbsoluteElevation());
+ selection_country = new EntitySelectionFieldController<NamedArea>(fieldObservationGeneralElement.getCountrySelectionField(), getFormFactory(), getConversationHolder(), formElement, NamedArea.class, entity.getGatheringEvent().getCountry(), EntitySelectionElement.NOTHING);
+ languageText_locality = new LanguageTextFieldController(fieldObservationGeneralElement.getTextLocality(), getFormFactory(), formElement, entity.getGatheringEvent().getLocality());
+ element_point = new PointFieldController(fieldObservationGeneralElement.getPointField(),getFormFactory(), formElement, entity.getGatheringEvent().getExactLocation(), style);
+ number_elevation = new NumberFieldController(fieldObservationGeneralElement.getTextElevation(), getFormFactory(), formElement, entity.getGatheringEvent().getAbsoluteElevation());
// element_date = formFactory.createTimePeriodElement(formElement, "Date", entity.getGatheringPeriod(), style);
- selection_collector = new EntitySelectionFieldController<AgentBase>(fieldObservationGeneralElement.getCollectorSelectionField(), getFormFactory(), getConversationHolder(), formElement, AgentBase.class, entity.getCollector(), EntitySelectionElement.ALL);
+ selection_collector = new EntitySelectionFieldController<AgentBase>(fieldObservationGeneralElement.getCollectorSelectionField(), getFormFactory(), getConversationHolder(), formElement, AgentBase.class, entity.getGatheringEvent().getCollector(), EntitySelectionElement.ALL);
text_collectingNumber = new TextFieldController(fieldObservationGeneralElement.getTextCollectingNumber(), getFormFactory(), formElement, entity.getFieldNumber(), null);
}
if (eventSource == toggleableText_titleCache) {
getEntity().setTitleCache(toggleableText_titleCache.getText(), toggleableText_titleCache.getState());
} else if (eventSource == selection_country) {
- getEntity().setCountry(selection_country.getSelection());
+ getEntity().getGatheringEvent().setCountry(selection_country.getSelection());
} else if (eventSource == languageText_locality) {
LanguageString locality = languageText_locality.getLanguageString();
- getEntity().setLocality(locality);
+ getEntity().getGatheringEvent().setLocality(locality);
} else if (eventSource == element_point) {
- getEntity().setExactLocation(element_point.getPoint());
+ getEntity().getGatheringEvent().setExactLocation(element_point.getPoint());
} else if (eventSource == number_elevation) {
- getEntity().setAbsoluteElevation(number_elevation.getInteger());
- } else if (eventSource == element_date) {
- getEntity().setGatheringPeriod(element_date.getTimePeriod());
+ getEntity().getGatheringEvent().setAbsoluteElevation(number_elevation.getInteger());
+// } else if (eventSource == element_date) {
+// getEntity().setGatheringPeriod(element_date.getTimePeriod());
} else if (eventSource == selection_collector) {
- getEntity().setCollector(selection_collector.getSelection());
+ getEntity().getGatheringEvent().setCollector(selection_collector.getSelection());
} else if (eventSource == text_collectingNumber) {
getEntity().setFieldNumber(text_collectingNumber.getText());
}
import org.eclipse.jface.viewers.ISelectionProvider;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+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;
* @date 16.08.2013
*
*/
-public class FieldObservationSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
+public class FieldObservationGeneralSection extends AbstractCdmDetailSection<FieldUnit> implements IDerivedUnitFacadeDetailSection{
/**
* <p>Constructor for FieldObservationDetailSection.</p>
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
* @param style a int.
*/
- public FieldObservationSection(CdmFormFactory formFactory, ConversationHolder conversation,
+ public FieldObservationGeneralSection(CdmFormFactory formFactory, ConversationHolder conversation,
ICdmFormElement parentElement,
ISelectionProvider selectionProvider, int style) {
super(formFactory, conversation, parentElement, selectionProvider, style);
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
*/
@Override
- protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
- return formFactory.createFieldObservationGeneralElement(parentElement);
+ protected AbstractCdmDetailElement<FieldUnit> createCdmDetailElement(AbstractCdmDetailSection<FieldUnit> parentElement, int style) {
+ return formFactory.createFieldObservationGeneralElementController(parentElement);
}
}
*/
package eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectingAreasDetailSection;
/**
* @author pplitzner
* @date 14.08.2013
*
*/
-public class GatheringEventDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+public class GatheringEventDetailsElementController extends AbstractCdmDetailElement<FieldUnit> {
private GatheringEventDetailsElement gatheringEventDetailsElement;
private TextFieldController text_gatheringEventDescription;
- private CollectingAreasDetailSection section_collectingAreas;
+// private CollectingAreasDetailSection section_collectingAreas;
/**
* <p>
/** {@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} */
// }
// } 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());
}
}
}
--- /dev/null
+// $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<FieldUnit> implements IDerivedUnitFacadeDetailSection{
+
+ /**
+ * <p>Constructor for GatheringEventDetailSection.</p>
+ *
+ * @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 GatheringEventSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getHeading() {
+ return "Gathering Event Details";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+ */
+ @Override
+ protected AbstractCdmDetailElement<FieldUnit> createCdmDetailElement(AbstractCdmDetailSection<FieldUnit> parentElement, int style) {
+ return formFactory.createGatheringEventDetailsElementController(parentElement);
+ }
+}
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsElement;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsSection;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElement;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElementController;
-import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralSection;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventDetailsElement;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventSection;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenGeneralElement;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenGeneralElementController;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenSection;
element = new NamedAreaDetailElement(this, parentElement, (NamedArea) entity, removeListener, style);
} else if (entity instanceof DeterminationEvent) {
element = new DeterminationEventDetailElement(this, parentElement, (DeterminationEvent) entity, removeListener, style);
- } else if (entity instanceof DerivedUnit && ((DerivedUnit)entity).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen) {
- element = new SpecimenCollectionDetailElement(this, parentElement, (DerivedUnit) entity, removeListener, style);
} else if (entity instanceof User) {
element = new MemberDetailElement(this, parentElement, (User) entity, removeListener, style);
} else if (entity instanceof GrantedAuthority) {
* @param i
* @return
*/
- public FieldObservationSection createFieldObservationSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
- FieldObservationSection section = new FieldObservationSection(this, conversation, parentElement, selectionProvider, style);
+ public FieldObservationGeneralSection createFieldObservationGeneralSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ FieldObservationGeneralSection section = new FieldObservationGeneralSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+ /**
+ * @param conversationHolder
+ * @param parent
+ * @param detailsViewer
+ * @param i
+ * @return
+ */
+ public GatheringEventSection createGatheringEventSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ GatheringEventSection section = new GatheringEventSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+ /**
+ * @param conversationHolder
+ * @param parent
+ * @param detailsViewer
+ * @param i
+ * @return
+ */
+ public FieldObservationDetailsSection createFieldObservationDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ FieldObservationDetailsSection section = new FieldObservationDetailsSection(this, conversation, parentElement, selectionProvider, style);
addAndAdaptSection(parentElement, section);
return section;
}
return element;
}
- public FieldObservationGeneralElementController createFieldObservationGeneralElement(ICdmFormElement parentElement){
+ public FieldObservationGeneralElementController createFieldObservationGeneralElementController(ICdmFormElement parentElement){
FieldObservationGeneralElement fieldObservationGeneralElement = new FieldObservationGeneralElement(parentElement.getLayoutComposite(), SWT.NONE);
fieldObservationGeneralElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
FieldObservationGeneralElementController element = new FieldObservationGeneralElementController(fieldObservationGeneralElement, this, parentElement);
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventSection;
import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenSection;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.RootElement;
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
public void setInput(Object input) {
if (input instanceof DerivedUnit) {
try {
- input = DerivedUnitFacade.NewInstance((DerivedUnit) input,
- PreferencesUtil.getDerivedUnitConfigurator());
+ input = DerivedUnitFacade.NewInstance((DerivedUnit) input,PreferencesUtil.getDerivedUnitConfigurator());
} catch (DerivedUnitFacadeNotSupportedException e) {
AbstractUtility.error(getClass(), e);
}
createMediaElementSection(rootElement);
} else if (input instanceof DerivedUnitFacade) {
+ createSpecimenDetailsView(rootElement);
+
+ } else if (input instanceof FieldUnit) {
createDerivedUnitBaseElementSection(rootElement);
} else if (input instanceof FeatureNodeContainer) {
private void createDerivedUnitBaseElementSection(RootElement parent) {
destroySections();
- FieldObservationSection fieldObservationSection = formFactory.createFieldObservationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+ FieldObservationGeneralSection fieldObservationSection = formFactory.createFieldObservationGeneralSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFieldObservationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+ GatheringEventSection gatheringEventDetailSection = formFactory.createGatheringEventSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- SpecimenSection specimenSection = formFactory.createSpecimenSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ FieldObservationDetailsSection fieldObservationDetailSection = formFactory.createFieldObservationDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
// DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
//
// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(fieldObservationSection);
addPart(gatheringEventDetailSection);
addPart(fieldObservationDetailSection);
- addPart(specimenSection);
// addPart(derivedUnitBaseDetailSection);
// addPart(determinationDetailSection);
}
+ /**
+ * createDerivedUnitBaseElementSection
+ *
+ * @param parent
+ */
+ private void createSpecimenDetailsView(RootElement parent) {
+ destroySections();
+
+ SpecimenSection specimenSection = formFactory.createSpecimenSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ addPart(specimenSection);
+ }
+
/**
* @param rootElement
*/