merge-update from trunk
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / element / CdmFormFactory.java
index 408e0acfea307c29a39237870be66c0eaa3639d0..ac9f81406f92a71774eec8cfb87cf24c2b9cf1eb 100644 (file)
@@ -41,36 +41,37 @@ import org.joda.time.Partial;
 import org.springframework.security.core.GrantedAuthority;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Credit;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-import eu.etaxonomy.cdm.model.common.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.common.Extension;
 import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
-import eu.etaxonomy.cdm.model.common.IDefinedTerm;
+import eu.etaxonomy.cdm.model.common.IEnumTerm;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TimePeriod;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.model.common.VersionableEntity;
 import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.cdm.model.description.CommonTaxonName;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.description.Distribution;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.description.KeyStatement;
-import eu.etaxonomy.cdm.model.description.Modifier;
 import eu.etaxonomy.cdm.model.description.QuantitativeData;
-import eu.etaxonomy.cdm.model.description.Scope;
 import eu.etaxonomy.cdm.model.description.StateData;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
 import eu.etaxonomy.cdm.model.description.TaxonInteraction;
@@ -83,20 +84,38 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
 import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
 import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
 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.Specimen;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NamedAreaFieldController;
+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.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.DerivedUnitDetailsElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.DerivedUnitDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.DerivedUnitDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenDetailsElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenGeneralSection;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
 import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled;
 import eu.etaxonomy.taxeditor.ui.openurl.OpenUrlSelectorElement;
 import eu.etaxonomy.taxeditor.ui.password.EditPasswordElement;
@@ -189,6 +208,10 @@ import eu.etaxonomy.taxeditor.ui.section.name.ProtologueElement;
 import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
 import eu.etaxonomy.taxeditor.ui.section.name.SpecimenTypeDesignationElement;
 import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.AmplificationGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.AmplificationGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.ArtworkGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.ArtworkGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectingAreasDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectionDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.CurrentDeterminationDetailSection;
@@ -196,20 +219,45 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailElement
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitFacadeDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitFacadeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationEventDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationHistoryDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DnaSampleGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DnaSampleGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.LivingPlantPhotoGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.LivingPlantPhotoGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.NamedAreaDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenCurrentDeterminationDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenDeterminationDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenDeterminationDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenDeterminationHistoryDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.PreservedSpecimenSourceCollectionDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SequenceGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SequenceGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SequenceReferenceCollectionDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SequenceReferenceCollectionDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SingleReadGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SingleReadGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.SourceCollectionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenScanGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenScanGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.TissueSampleGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.TissueSampleGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailElement;
@@ -246,6 +294,7 @@ import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.FeatureDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
@@ -397,13 +446,6 @@ public class CdmFormFactory extends FormToolkit {
         }
     }
 
-    /** {@inheritDoc} */
-    @Override
-    public void adapt(Composite composite) {
-        composite.addMouseListener(selectionMouseHandler);
-        super.adapt(composite);
-    }
-
     /**
      * <p>
      * Adapts the {@link AbstractCdmFormElement}:<br>
@@ -428,6 +470,13 @@ public class CdmFormFactory extends FormToolkit {
         super.adapt(control, trackFocus, trackKeyboard);
     }
 
+    /** {@inheritDoc} */
+    @Override
+    public void adapt(Composite composite) {
+        composite.addMouseListener(selectionMouseHandler);
+        super.adapt(composite);
+    }
+
     /**
      * <p>
      * destroyElement
@@ -545,6 +594,21 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+    /**
+     * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
+     * method.<br>
+     * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
+     * @param parentElement the parent container
+     * @param labelString the label name
+     * @param initialObject the object from which the <code>toString()</code> method is called
+     * @param style {@link SWT} style constant
+     * @return the created textfield with label
+     */
+    public TextWithLabelElement createTextWithLabelElement(ICdmFormElement parentElement, String labelString,
+            Object initialObject, int style) {
+        return createTextWithLabelElement(parentElement, labelString, initialObject==null?"":initialObject.toString(), style);
+    }
+
     /**
      * <p>
      * createTextWithLabelElement
@@ -564,6 +628,10 @@ public class CdmFormFactory extends FormToolkit {
      */
     public TextWithLabelElement createTextWithLabelElement(ICdmFormElement parentElement, String labelString,
             String initialText, int style) {
+        if(initialText==null){
+            initialText = "";
+        }
+
         TextWithLabelElement element = new TextWithLabelElement(this, parentElement, labelString, initialText, null,
                 style);
         adapt(element);
@@ -630,41 +698,15 @@ public class CdmFormFactory extends FormToolkit {
      *         {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
      *         object.
      */
-    public NumberWithLabelElement createIntegerTextWithLabelElement(ICdmFormElement parentElement, String labelString,
-            Integer initialInteger, int style) {
-        NumberWithLabelElement element = new NumberWithLabelElement(this, parentElement, labelString, initialInteger,
-                style);
-        adapt(element);
-        parentElement.addElement(element);
-        return element;
-    }
-
-    /**
-     * <p>
-     * createFloatTextWithLabelElement
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param labelString
-     *            a {@link java.lang.String} object.
-     * @param initialFloat
-     *            a float.
-     * @param style
-     *            a int.
-     * @return a
-     *         {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
-     *         object.
-     */
-    public NumberWithLabelElement createFloatTextWithLabelElement(ICdmFormElement parentElement, String labelString,
-            float initialFloat, int style) {
-        NumberWithLabelElement element = new NumberWithLabelElement(this, parentElement, labelString, initialFloat,
-                style);
-        adapt(element);
-        parentElement.addElement(element);
-        return element;
-    }
+       public NumberWithLabelElement createNumberTextWithLabelElement(
+                       ICdmFormElement parentElement, String labelString,
+                       Number initialNumber, int style) {
+               NumberWithLabelElement element = new NumberWithLabelElement(this,
+                               parentElement, labelString, initialNumber, style);
+               adapt(element);
+               parentElement.addElement(element);
+               return element;
+       }
 
     /**
      * <p>
@@ -801,6 +843,41 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+       /**
+        * <p>
+        * createTermComboElement
+        * </p>
+        *
+        * @param termComboType
+        *            a
+        *            {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
+        *            object.
+        * @param parentElement
+        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+        *            object.
+        * @param labelString
+        *            a {@link java.lang.String} object.
+        * @param selection
+        *            a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
+        *            object.
+        * @param style
+        *            a int.
+        * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
+        *         object.
+        */
+
+       public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
+                       TermType termType,
+                       ICdmFormElement parentElement,
+                       String labelString,
+                       T selection,
+                       int style) {
+               TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termType, labelString, selection, style);
+               adapt(element);
+               parentElement.addElement(element);
+               return element;
+       }
+
     /**
      * <p>
      * createEnumComboElement
@@ -818,8 +895,9 @@ public class CdmFormFactory extends FormToolkit {
      * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
      *         object.
      */
-    public <T extends IDefinedTerm> EnumComboElement<T> createEnumComboElement(Class<T> enumComboType,
-            ICdmFormElement parentElement, int style) {
+       public <T extends IEnumTerm<T>> EnumComboElement<T> createEnumComboElement(
+                       Class<T> enumComboType, ICdmFormElement parentElement,
+                       int style) {
         EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, style);
         adapt(element);
         parentElement.addElement(element);
@@ -1040,6 +1118,40 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+       /**
+        * <p>
+        * createGatheringEventUnitElement
+        * </p>
+        *
+        * @param parentElement
+        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+        *            object.
+        * @param labelString
+        *            a {@link java.lang.String} object.
+        * @param timePeriod
+        *            a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
+        * @param style
+        *            a int.
+        * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
+        *         object.
+        */
+       public GatheringEventUnitElement createGatheringEventUnitElement(
+                       ICdmFormElement parentElement,
+                       String labelString,
+                       DerivedUnitFacade gatheringEvent,
+                       MinMaxTextSection.UnitType unitType,
+                       int style) {
+               GatheringEventUnitElement element = new GatheringEventUnitElement(this,
+                               parentElement,
+                               labelString,
+                               gatheringEvent,
+                               unitType,
+                               style);
+               adapt(element);
+               parentElement.addElement(element);
+               return element;
+       }
+
     /**
      * <p>
      * createPointElement
@@ -1081,6 +1193,26 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+       /**
+        * <p>
+        * createDateDetailSection
+        * </p>
+        *
+        * @param parentElement
+        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+        *            object.
+        * @param style
+        *            a int.
+        * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
+        *         object.
+        */
+       public MinMaxTextSection createMinMaxTextSection(ICdmFormElement parentElement, UnitType unitType, int style) {
+               MinMaxTextSection section = new MinMaxTextSection(this, parentElement, unitType, style);
+               parentElement.addElement(section);
+               adapt(section);
+               return section;
+       }
+
     /**
      * <p>
      * createPartialElement
@@ -1164,6 +1296,13 @@ public class CdmFormFactory extends FormToolkit {
         propertyChangeListeners.remove(listener);
     }
 
+    /**
+     * @return the propertyChangeListeners
+     */
+    public List<IPropertyChangeListener> getPropertyChangeListeners() {
+        return propertyChangeListeners;
+    }
+
     /**
      * <p>
      * createHorizontalSeparator
@@ -1331,11 +1470,14 @@ public class CdmFormFactory extends FormToolkit {
      * @param style
      * @return
      */
-    public AbstractCdmDetailElement createDefinedTermDetailElement(Class definedTermClass, AbstractCdmDetailSection parentElement, int style) {
+    public AbstractCdmDetailElement createDefinedTermDetailElement(Class definedTermClass,
+            AbstractCdmDetailSection parentElement, int style) {
         AbstractCdmDetailElement element = null;
 
         if (NamedArea.class.isAssignableFrom(definedTermClass)) {
             element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
+        } else if (definedTermClass.equals(Feature.class)) {
+            element = new FeatureDetailElement(this, parentElement);
         } else {
             element = new DefinedTermDetailElement(this, parentElement);
         }
@@ -1431,8 +1573,8 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    public FieldObservationDetailSection createFieldObservationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        FieldObservationDetailSection section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public FieldUnitDetailSection createFieldUnitDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldUnitDetailSection section = new FieldUnitDetailSection(this, conversation, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -1491,8 +1633,74 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    public GeneralDetailSection createGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        GeneralDetailSection section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public FieldUnitGeneralDetailSection createFieldUnitGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldUnitGeneralDetailSection section = new FieldUnitGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DerivedUnitGeneralDetailSection createDerivedUnitGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitGeneralDetailSection section = new DerivedUnitGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public PreservedSpecimenGeneralDetailSection createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PreservedSpecimenGeneralDetailSection section = new PreservedSpecimenGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TissueSampleGeneralDetailSection createTissueSampleGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TissueSampleGeneralDetailSection section = new TissueSampleGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DnaSampleGeneralDetailSection createDnaSampleGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DnaSampleGeneralDetailSection section = new DnaSampleGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public SequenceGeneralDetailSection createSequenceGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        SequenceGeneralDetailSection section = new SequenceGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public SequenceReferenceCollectionDetailSection createSequenceReferenceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        SequenceReferenceCollectionDetailSection section = new SequenceReferenceCollectionDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public SingleReadGeneralDetailSection createSingleReadGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        SingleReadGeneralDetailSection section = new SingleReadGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public AmplificationGeneralDetailSection createAmplificationGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        AmplificationGeneralDetailSection section = new AmplificationGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public SpecimenScanGeneralDetailSection createSpecimenScanGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        SpecimenScanGeneralDetailSection section = new SpecimenScanGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public LivingPlantPhotoGeneralDetailSection createLivingPlantPhotoGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        LivingPlantPhotoGeneralDetailSection section = new LivingPlantPhotoGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ArtworkGeneralDetailSection createArtworkGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ArtworkGeneralDetailSection section = new ArtworkGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -1521,6 +1729,12 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public PreservedSpecimenDeterminationDetailSection createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PreservedSpecimenDeterminationDetailSection section = new PreservedSpecimenDeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public TaxonRelationshipDetailSection createTaxonRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
         TaxonRelationshipDetailSection section = new TaxonRelationshipDetailSection(this, conversation, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
@@ -1539,6 +1753,11 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public GatheringEventDetailSection createGatheringSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
 
     public NamedAreaDetailSection createNamedAreaDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
         NamedAreaDetailSection section = new NamedAreaDetailSection(this, conversation, parentElement, selectionProvider, style);
@@ -1552,24 +1771,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    public GeneralDetailSection createFOSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        GeneralDetailSection section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
-        addAndAdaptSection(parentElement, section);
-        return section;
-    }
-
-    public GatheringEventDetailSection createGatheringSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
-        addAndAdaptSection(parentElement, section);
-        return section;
-    }
-
-    public FieldObservationDetailSection createFODetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        FieldObservationDetailSection section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
-        addAndAdaptSection(parentElement, section);
-        return section;
-    }
-
     private void addAndAdaptSection(ICdmFormElement parentElement, AbstractFormSection<?> section) {
         parentElement.addElement(section);
         adapt(section);
@@ -1752,30 +1953,104 @@ public class CdmFormFactory extends FormToolkit {
     }
 
 
-    public GeneralDetailElement createGeneralDetailElement(ICdmFormElement parentElement){
-        GeneralDetailElement element = new GeneralDetailElement(this, parentElement);
+    public FieldUnitGeneralDetailElement createFieldUnitGeneralDetailElement(ICdmFormElement parentElement){
+        FieldUnitGeneralDetailElement element = new FieldUnitGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DerivedUnitGeneralDetailElement createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement){
+        DerivedUnitGeneralDetailElement element = new DerivedUnitGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PreservedSpecimenGeneralDetailElement createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement){
+        PreservedSpecimenGeneralDetailElement element = new PreservedSpecimenGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TissueSampleGeneralDetailElement createTissueSampleGeneralDetailElement(ICdmFormElement parentElement){
+        TissueSampleGeneralDetailElement element = new TissueSampleGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DnaSampleGeneralDetailElement createDnaSampleGeneralDetailElement(ICdmFormElement parentElement){
+        DnaSampleGeneralDetailElement element = new DnaSampleGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public SequenceGeneralDetailElement createSequenceGeneralDetailElement(ICdmFormElement parentElement){
+        SequenceGeneralDetailElement element = new SequenceGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public SingleReadGeneralDetailElement createSingleReadGeneralDetailElement(ICdmFormElement parentElement){
+        SingleReadGeneralDetailElement element = new SingleReadGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public AmplificationGeneralDetailElement createAmplificationGeneralDetailElement(ICdmFormElement parentElement){
+        AmplificationGeneralDetailElement element = new AmplificationGeneralDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
         return element;
     }
 
+    public SpecimenScanGeneralDetailElement createSpecimenScanGeneralDetailElement(ICdmFormElement parentElement){
+        SpecimenScanGeneralDetailElement element = new SpecimenScanGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public LivingPlantPhotoGeneralDetailElement createLivingPlantPhotoGeneralDetailElement(ICdmFormElement parentElement){
+        LivingPlantPhotoGeneralDetailElement element = new LivingPlantPhotoGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public ArtworkGeneralDetailElement createArtworkGeneralDetailElement(ICdmFormElement parentElement){
+        ArtworkGeneralDetailElement element = new ArtworkGeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+
     public GatheringEventDetailElement createGatheringEventDetailElement(ICdmFormElement parentElement) {
         GatheringEventDetailElement element = new GatheringEventDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
         return element;
     }
 
-    public FieldObservationDetailElement createFieldObservationDetailElement(ICdmFormElement parentElement) {
-        FieldObservationDetailElement element = new FieldObservationDetailElement(this, parentElement);
+    public FieldUnitDetailElement createFieldUnitDetailElement(ICdmFormElement parentElement) {
+        FieldUnitDetailElement element = new FieldUnitDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
         return element;
     }
 
+
     public DerivedUnitBaseDetailElement createDerivedUnitBaseDetailElement(ICdmFormElement parentElement) {
         DerivedUnitBaseDetailElement element = new DerivedUnitBaseDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
         return element;
     }
 
+    public PreservedSpecimenDetailElement createPreservedSpecimenDetailElement(ICdmFormElement parentElement) {
+        PreservedSpecimenDetailElement element = new PreservedSpecimenDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PreservedSpecimenDeterminationDetailElement createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement) {
+        PreservedSpecimenDeterminationDetailElement element = new PreservedSpecimenDeterminationDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
     public DeterminationDetailElement createDeterminationDetailElement(ICdmFormElement parentElement) {
         DeterminationDetailElement element = new DeterminationDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
@@ -1936,18 +2211,36 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public PreservedSpecimenCurrentDeterminationDetailSection createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        PreservedSpecimenCurrentDeterminationDetailSection section = new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public DeterminationHistoryDetailSection createDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         DeterminationHistoryDetailSection section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
+    public PreservedSpecimenDeterminationHistoryDetailSection createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        PreservedSpecimenDeterminationHistoryDetailSection section = new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public SpecimenCollectionDetailSection createSpecimenCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         SpecimenCollectionDetailSection section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
+    public PreservedSpecimenSourceCollectionDetailSection createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        PreservedSpecimenSourceCollectionDetailSection section = new PreservedSpecimenSourceCollectionDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public SourceCollectionDetailSection createSourceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         SourceCollectionDetailSection section = new SourceCollectionDetailSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
@@ -2049,10 +2342,28 @@ public class CdmFormFactory extends FormToolkit {
         } else if (entity instanceof IdentifiableSource) {
             element = new IdentifiableSourceElement(this, parentElement, (IdentifiableSource) entity, removeListener,
                     style);
-        } else if (entity instanceof Scope) {
-            element = new ScopeElement(this, parentElement, (Scope) entity, removeListener, style);
-        } else if (entity instanceof Modifier) {
-            element = new ModifierElement(this, parentElement, (Modifier) entity, removeListener, style);
+               } else if (entity instanceof DefinedTerm) {
+                       switch(((DefinedTerm)entity).getTermType()) {
+                               case Scope:
+                                       element = new ScopeElement(this,
+                                                       parentElement,
+                                                       (DefinedTerm) entity,
+                                                       removeListener,
+                                                       style);
+                                       break;
+                               case Modifier:
+                                       element = new ModifierElement(this,
+                                                       parentElement,
+                                                       (DefinedTerm) entity,
+                                                       removeListener,
+                                                       style);
+                                       break;
+                               default:
+                                       //FIXME : Actually we should through an exception here
+                                       element = null;
+                                       break;
+
+                       }
         } else if (entity instanceof Reference) {
             element = new DescriptionSourceElement(this, parentElement, (Reference) entity, removeListener, style);
         } else if (entity instanceof NameTypeDesignation) {
@@ -2070,14 +2381,28 @@ public class CdmFormFactory extends FormToolkit {
             element = new StatisticalMeasurementValueElement(this, parentElement, (StatisticalMeasurementValue) entity,
                     removeListener, style);
         } else if (entity instanceof DerivedUnit) {
-            element = new DerivedUnitElement(this, parentElement, (DerivedUnit) entity, removeListener, style);
+               switch(((DerivedUnit)entity).getRecordBasis()) {
+                               case LivingSpecimen:
+                               case PreservedSpecimen:
+                               case OtherSpecimen:
+                                       element = new SpecimenCollectionDetailElement(this,
+                                                               parentElement,
+                                                               (DerivedUnit) entity,
+                                                               removeListener,
+                                                               style);
+                                       break;
+                               default:
+                                       element = new DerivedUnitElement(this,
+                                                               parentElement,
+                                                               (DerivedUnit) entity,
+                                                               removeListener,
+                                                               style);
+                       }
+
         } else if (entity instanceof NamedArea) {
             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 Specimen) {
-            element = new SpecimenCollectionDetailElement(this, parentElement, (Specimen) entity, removeListener, style);
+            element = new DeterminationEventDetailElement(this, parentElement, (DeterminationEvent) entity, removeListener, style);
         } else if (entity instanceof User) {
             element = new MemberDetailElement(this, parentElement, (User) entity, removeListener, style);
         } else if (entity instanceof GrantedAuthority) {
@@ -2094,6 +2419,8 @@ public class CdmFormFactory extends FormToolkit {
             if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
                 element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
             }
+        } else if (entity instanceof Sequence) {
+            element = new SequenceReferenceCollectionDetailElement(this, parentElement, (Sequence) entity, removeListener, style);
         }
 
         if (element == null) {
@@ -2104,11 +2431,18 @@ public class CdmFormFactory extends FormToolkit {
 
         else if (backgroundColor != null && !backgroundColor.isDisposed()) {
             element.setPersistentBackground(backgroundColor);
+            adapt(element);
+            parentElement.addElement(element);
         }
 
+        return element;
+    }
+
+    public void createNamedAreaFieldController(AbstractFormSection parentElement, NamedArea namedArea, SelectionListener removeListener){
+//        Object entity = HibernateProxyHelper.deproxy(versionableEntity); TODO deproxy necessary??
+        NamedAreaFieldController element = new NamedAreaFieldController(this, parentElement, namedArea, removeListener, SWT.NONE);
         adapt(element);
         parentElement.addElement(element);
-        return element;
     }
 
     /**
@@ -2264,4 +2598,118 @@ public class CdmFormFactory extends FormToolkit {
         return text;
     }
 
+
+
+    /**
+     * @param conversationHolder
+     * @param parent
+     * @param detailsViewer
+     * @param i
+     * @return
+     */
+    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;
+    }
+
+    public SpecimenGeneralSection createSpecimenSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+        SpecimenGeneralSection section = new SpecimenGeneralSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public PreservedSpecimenDetailSection createPreservedSpecimenDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+        PreservedSpecimenDetailSection section = new PreservedSpecimenDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DerivedUnitDetailsSection createDerivedUnitDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+        DerivedUnitDetailsSection section = new DerivedUnitDetailsSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public FieldObservationGeneralElementController createSpecimenGeneralElementController(ICdmFormElement parentElement){
+        return createFieldObservationGeneralElementController_internal(parentElement, true, false);
+    }
+
+    public SpecimenDetailsElementController createSpecimenDetailsElementController(ICdmFormElement parentElement){
+        SpecimenDetailsElement element = new SpecimenDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+        element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+        SpecimenDetailsElementController controller = new SpecimenDetailsElementController(element, this, parentElement);
+        addAndAdaptElement(parentElement, controller);
+        return controller;
+    }
+
+    public DerivedUnitDetailsElementController createDerivedUnitDetailsElementController(ICdmFormElement parentElement){
+        DerivedUnitDetailsElement element = new DerivedUnitDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+        element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+        DerivedUnitDetailsElementController controller = new DerivedUnitDetailsElementController(element, this, parentElement);
+        addAndAdaptElement(parentElement, controller);
+        return controller;
+    }
+
+    public FieldObservationGeneralElementController createSpecimenGeneralElementControllerWizard(ICdmFormElement parentElement){
+        return createFieldObservationGeneralElementController_internal(parentElement, true, true);
+    }
+
+    public FieldObservationGeneralElementController createFieldObservationGeneralElementControllerWizard(ICdmFormElement parentElement){
+        return createFieldObservationGeneralElementController_internal(parentElement, false, true);
+    }
+
+    public FieldObservationGeneralElementController createFieldObservationGeneralElementController(ICdmFormElement parentElement){
+        return createFieldObservationGeneralElementController_internal(parentElement, false, false);
+    }
+
+    private FieldObservationGeneralElementController createFieldObservationGeneralElementController_internal(ICdmFormElement parentElement, boolean isSpecimen, boolean isWizard){
+        FieldObservationGeneralElement element = new FieldObservationGeneralElement(parentElement.getLayoutComposite(), SWT.NONE);
+        element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+        FieldObservationGeneralElementController controller = new FieldObservationGeneralElementController(element, this, parentElement, isSpecimen, isWizard);
+        addAndAdaptElement(parentElement, controller);
+        return controller;
+    }
+
+    public GatheringEventDetailsElementController createGatheringEventDetailsElementController(ICdmFormElement parentElement) {
+        GatheringEventDetailsElement element = new GatheringEventDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+        element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+        GatheringEventDetailsElementController controller = new GatheringEventDetailsElementController(element, this, parentElement);
+        adapt(controller);
+        parentElement.addElement(controller);
+        return controller;
+    }
+
+    public FieldObservationDetailsElementController createFieldObservationDetailsElementController(ICdmFormElement parentElement) {
+        FieldObservationDetailsElement element = new FieldObservationDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+        element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+        FieldObservationDetailsElementController controller = new FieldObservationDetailsElementController(element, this, parentElement);
+        addAndAdaptElement(parentElement, controller);
+        return controller;
+    }
+
 }