- removed the use of DetailType enum for the creation of GeneralDetailSection
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 10 Jun 2013 11:36:17 +0000 (11:36 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 10 Jun 2013 11:36:17 +0000 (11:36 +0000)
 - added "enum-free" creation methods for Abstract CdmDetailSection

eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index 9fb167cc8644ced846238dee40784f7341832719..4cf488ee33f1a17bac6e7badc2adfac6cf54f75d 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar differ
index 2bcf6b521df44e9cb322a8d783d1981329055052..534b93d32bed93c58e9a28d9c49c3ad83535b403 100644 (file)
@@ -131,6 +131,7 @@ import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceEle
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;
+import eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection;
 import eu.etaxonomy.taxeditor.ui.section.description.ModifierElement;
 import eu.etaxonomy.taxeditor.ui.section.description.ModifierSection;
 import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.description.ModifierElement;
 import eu.etaxonomy.taxeditor.ui.section.description.ModifierSection;
 import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageDetailElement;
@@ -268,7 +269,7 @@ public class CdmFormFactory extends FormToolkit {
     private MouseListener selectionMouseHandler;
     private FocusListener selectionFocusHandler;
 
     private MouseListener selectionMouseHandler;
     private FocusListener selectionFocusHandler;
 
-    private final Set selectionListenerList = new HashSet();
+    private final Set<SelectionListener> selectionListenerList = new HashSet<SelectionListener>();
 
     private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
 
 
     private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
 
@@ -314,8 +315,8 @@ public class CdmFormFactory extends FormToolkit {
         event.widget = e.widget;
         SelectionEvent selectionEvent = new SelectionEvent(event);
 
         event.widget = e.widget;
         SelectionEvent selectionEvent = new SelectionEvent(event);
 
-        for (Object listener : selectionListenerList) {
-            ((SelectionListener) listener).widgetSelected(selectionEvent);
+        for (SelectionListener listener : selectionListenerList) {
+            listener.widgetSelected(selectionEvent);
         }
     }
 
         }
     }
 
@@ -1396,27 +1397,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
         return element;
     }
 
-    public GeneralDetailSection createFOSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        GeneralDetailSection generalSection = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
-        parentElement.addElement(generalSection);
-        adapt(generalSection);
-        return generalSection;
-    }
-
-    public GatheringEventDetailSection createGatheringSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        GatheringEventDetailSection gatheringSection = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
-        parentElement.addElement(gatheringSection);
-        adapt(gatheringSection);
-        return gatheringSection;
-    }
-
-    public FieldObservationDetailSection createFODetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        FieldObservationDetailSection foDetailsSection = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
-        parentElement.addElement(foDetailsSection);
-        adapt(foDetailsSection);
-        return foDetailsSection;
-    }
-
     /**
      * <p>
      * createCdmDetailSection
     /**
      * <p>
      * createCdmDetailSection
@@ -1443,7 +1423,6 @@ public class CdmFormFactory extends FormToolkit {
             ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
         AbstractFormSection section = null;
 
             ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
         AbstractFormSection section = null;
 
-//        System.out.println("DetailSection: " + detailType);
         switch (detailType) {
         case SCIENTIFICNAME:
             section = new NameDetailSection(this, conversation, parentElement, selectionProvider, style);
         switch (detailType) {
         case SCIENTIFICNAME:
             section = new NameDetailSection(this, conversation, parentElement, selectionProvider, style);
@@ -1560,6 +1539,236 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
         return section;
     }
 
+    public NameDetailSection createNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NameDetailSection section = new NameDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public ReferenceDetailSection createReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ReferenceDetailSection section = new ReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public NomenclaturalReferenceDetailSection createNomenclaturalReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NomenclaturalReferenceDetailSection section = new NomenclaturalReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public TaxonBaseDetailSection createTaxonBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonBaseDetailSection section = new TaxonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public AuthorshipDetailSection createAuthorshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        AuthorshipDetailSection section = new AuthorshipDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public TeamOrPersonBaseDetailSection createTeamOrPersonBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TeamOrPersonBaseDetailSection section = new TeamOrPersonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public TeamDetailSection createTeamDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        TeamDetailSection section = new TeamDetailSection(this, conversation, parentElement, null, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public PersonDetailSection createPersonDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        PersonDetailSection section = new PersonDetailSection(this, conversation, parentElement, null, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public DescriptionDetailSection createDescriptionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DescriptionDetailSection section = new DescriptionDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public DescriptionElementDetailSection createDescriptionElementDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DescriptionElementDetailSection section = new DescriptionElementDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public ParsingMessagesSection createParsingMessagesSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ParsingMessagesSection section = new ParsingMessagesSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public NonViralNameDetailSection createNonViralNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NonViralNameDetailSection section = new NonViralNameDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public MediaDetailsSection createMediaDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        MediaDetailsSection section = new MediaDetailsSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public DerivedUnitFacadeDetailSection createDerivedUnitFacadeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitFacadeDetailSection section = new DerivedUnitFacadeDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public FieldObservationDetailSection createFieldObservationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldObservationDetailSection section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public GatheringEventDetailSection createGatheringEventDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public DerivedUnitBaseDetailSection createDerivedUnitBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitBaseDetailSection section = new DerivedUnitBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public NaturalLanguageSection createNaturalLanguageSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NaturalLanguageSection section = new NaturalLanguageSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public FeatureDistributionDetailSection createFeatureDistributionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FeatureDistributionDetailSection section = new FeatureDistributionDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public ClassificationDetailSection createClassificationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ClassificationDetailSection section = new ClassificationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public TaxonNodeDetailSection createTaxonNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonNodeDetailSection section = new TaxonNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public PolytomousKeyDetailSection createPolytomousKeyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PolytomousKeyDetailSection section = new PolytomousKeyDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public PolytomousKeyNodeDetailSection createPolytomousKeyNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PolytomousKeyNodeDetailSection section = new PolytomousKeyNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public InstitutionDetailSection createInstitutionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        InstitutionDetailSection section = new InstitutionDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public GeneralDetailSection createGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GeneralDetailSection section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public HybridDetailSection createHybridDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        HybridDetailSection section = new HybridDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public UserDetailSection createUserDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        UserDetailSection section = new UserDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public GroupDetailSection createGroupDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GroupDetailSection section = new GroupDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public DeterminationDetailSection createDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DeterminationDetailSection section = new DeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public TaxonRelationshipDetailSection createTaxonRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonRelationshipDetailSection section = new TaxonRelationshipDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public ReferencedEntityDetailSection createReferencedEntityDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ReferencedEntityDetailSection section = new ReferencedEntityDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public TermVocabularyDetailSection createTermVocabularyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TermVocabularyDetailSection section = new TermVocabularyDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+
+    public NamedAreaDetailSection createNamedAreaDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NamedAreaDetailSection section = new NamedAreaDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public UseRecordDetailSection createUseRecordDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        UseRecordDetailSection section = new UseRecordDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public GeneralDetailSection createFOSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GeneralDetailSection section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public GatheringEventDetailSection createGatheringSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdapt(parentElement, section);
+        return section;
+    }
+
+    public FieldObservationDetailSection createFODetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldObservationDetailSection foDetailsSection = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        parentElement.addElement(foDetailsSection);
+        adapt(foDetailsSection);
+        return foDetailsSection;
+    }
+
+    private void addAndAdapt(ICdmFormElement parentElement, AbstractFormSection<?> section) {
+        parentElement.addElement(section);
+        adapt(section);
+    }
+
+
     /**
      * <p>
      * createCdmDetailElement
     /**
      * <p>
      * createCdmDetailElement
@@ -1698,6 +1907,45 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
         return element;
     }
 
+    public GeneralDetailElement createGeneralDetailElement(ICdmFormElement parentElement){
+        GeneralDetailElement element = new GeneralDetailElement(this, parentElement);
+        addAndAdapt(parentElement, element);
+        return element;
+    }
+
+    public GatheringEventDetailElement createGatheringEventDetailElement(ICdmFormElement parentElement) {
+        GatheringEventDetailElement element = new GatheringEventDetailElement(this, parentElement);
+        addAndAdapt(parentElement, element);
+        return element;
+    }
+
+    public FieldObservationDetailElement createFieldObservationDetailElement(ICdmFormElement parentElement) {
+        FieldObservationDetailElement element = new FieldObservationDetailElement(this, parentElement);
+        addAndAdapt(parentElement, element);
+        return element;
+    }
+
+    public DerivedUnitBaseDetailElement createDerivedUnitBaseDetailElement(ICdmFormElement parentElement) {
+        DerivedUnitBaseDetailElement element = new DerivedUnitBaseDetailElement(this, parentElement);
+        addAndAdapt(parentElement, element);
+        return element;
+    }
+
+    public DeterminationDetailElement createDeterminationDetailElement(ICdmFormElement parentElement) {
+        DeterminationDetailElement element = new DeterminationDetailElement(this, parentElement);
+        addAndAdapt(parentElement, element);
+        return element;
+    }
+
+    /**
+     * @param parentElement
+     * @param element
+     */
+    private void addAndAdapt(ICdmFormElement parentElement, AbstractCdmDetailElement<?> element) {
+        adapt(element);
+        parentElement.addElement(element);
+    }
+
     /**
      *
      * Used to define which {@link AbstractEntityCollectionSection} should be
     /**
      *
      * Used to define which {@link AbstractEntityCollectionSection} should be
index ff6292ab6f0ff8284ddb664a8066527e6b2808a5..62cae18b82bdc055a87e4647b3c7b3355b45f4e4 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
  * 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.
  */
  * 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.
  */
@@ -28,20 +28,17 @@ import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
-import eu.etaxonomy.taxeditor.ui.element.ISelectable;
 
 /**
  * <p>
  * Abstract AbstractCdmDetailElement class.
  * </p>
 
 /**
  * <p>
  * Abstract AbstractCdmDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Feb 26, 2010
  * @version 1.0
  */
  * @author n.hoffmann
  * @created Feb 26, 2010
  * @version 1.0
  */
-public abstract class AbstractCdmDetailElement<T> extends
-               AbstractCdmFormElement implements IEntityElement<T>,
-               IEnableableFormElement, IConversationEnabled, ISelectable {
+public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement implements IEntityElement<T>, IEnableableFormElement, IConversationEnabled {
 
        private T entity;
 
 
        private T entity;
 
@@ -51,7 +48,7 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * Constructor for AbstractCdmDetailElement.
         * </p>
         * <p>
         * Constructor for AbstractCdmDetailElement.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -63,14 +60,14 @@ public abstract class AbstractCdmDetailElement<T> extends
         */
        public AbstractCdmDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
         */
        public AbstractCdmDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
-               super(formFactory, (ICdmFormElement) formElement);
+               super(formFactory, formElement);
                // register as property change listener
                formFactory.addPropertyChangeListener(this);
        }
 
        /**
         * Sets the entity and updates controls
                // register as property change listener
                formFactory.addPropertyChangeListener(this);
        }
 
        /**
         * Sets the entity and updates controls
-        * 
+        *
         * @param entity
         *            a T object.
         */
         * @param entity
         *            a T object.
         */
@@ -81,17 +78,18 @@ public abstract class AbstractCdmDetailElement<T> extends
 
        /*
         * (non-Javadoc)
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
         */
        /**
         * <p>
         * Getter for the field <code>entity</code>.
         * </p>
         * @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
         */
        /**
         * <p>
         * Getter for the field <code>entity</code>.
         * </p>
-        * 
+        *
         * @return a T object.
         */
         * @return a T object.
         */
-       public T getEntity() {
+       @Override
+    public T getEntity() {
                return entity;
        }
 
                return entity;
        }
 
@@ -106,12 +104,13 @@ public abstract class AbstractCdmDetailElement<T> extends
 
        /*
         * (non-Javadoc)
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.ISelectableComposite#setSelected(boolean)
         */
        /** {@inheritDoc} */
         * @see
         * eu.etaxonomy.taxeditor.forms.ISelectableComposite#setSelected(boolean)
         */
        /** {@inheritDoc} */
-       public void setSelected(boolean selected) {
+       @Override
+    public void setSelected(boolean selected) {
                Composite section = getLayoutComposite().getParent();
                section.setBackground(selected ? SELECTED : getPersistentBackground());
        }
                Composite section = getLayoutComposite().getParent();
                section.setBackground(selected ? SELECTED : getPersistentBackground());
        }
@@ -119,7 +118,7 @@ public abstract class AbstractCdmDetailElement<T> extends
        /**
         * Sets all field to the given enablement state except the objects in
         * collection except
        /**
         * Sets all field to the given enablement state except the objects in
         * collection except
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#setEnabled(boolean)
         * @param enabled
         *            a boolean.
         * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#setEnabled(boolean)
         * @param enabled
         *            a boolean.
@@ -143,7 +142,7 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * Setter for the field <code>irrelevant</code>.
         * </p>
         * <p>
         * Setter for the field <code>irrelevant</code>.
         * </p>
-        * 
+        *
         * @param irrelevant
         *            a boolean.
         * @param except
         * @param irrelevant
         *            a boolean.
         * @param except
@@ -168,19 +167,21 @@ public abstract class AbstractCdmDetailElement<T> extends
        }
 
        /** {@inheritDoc} */
        }
 
        /** {@inheritDoc} */
-       public void setEnabled(boolean enabled) {
+       @Override
+    public void setEnabled(boolean enabled) {
                setEnabled(enabled, null);
        }
 
        /** {@inheritDoc} */
                setEnabled(enabled, null);
        }
 
        /** {@inheritDoc} */
-       public void setIrrelevant(boolean irrelevant) {
+       @Override
+    public void setIrrelevant(boolean irrelevant) {
                this.irrelevant = irrelevant;
                setIrrelevant(irrelevant, null);
        }
 
        /**
         * Create all content elements
                this.irrelevant = irrelevant;
                setIrrelevant(irrelevant, null);
        }
 
        /**
         * Create all content elements
-        * 
+        *
         * @param formElement
         *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
         *            object.
         * @param formElement
         *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
         *            object.
@@ -246,7 +247,7 @@ public abstract class AbstractCdmDetailElement<T> extends
        /**
         * Gets called when the source of the event is a child widget of this
         * widget.
        /**
         * Gets called when the source of the event is a child widget of this
         * widget.
-        * 
+        *
         * @param eventSource
         *            a {@link java.lang.Object} object.
         */
         * @param eventSource
         *            a {@link java.lang.Object} object.
         */
@@ -256,7 +257,7 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * handleException
         * </p>
         * <p>
         * handleException
         * </p>
-        * 
+        *
         * @param event
         *            a
         *            {@link eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent}
         * @param event
         *            a
         *            {@link eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent}
@@ -271,7 +272,7 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * isIrrelevant
         * </p>
         * <p>
         * isIrrelevant
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        public boolean isIrrelevant() {
         * @return a boolean.
         */
        public boolean isIrrelevant() {
@@ -282,11 +283,12 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * getConversationHolder
         * </p>
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                if (getParentElement() instanceof IConversationEnabled) {
                        return ((IConversationEnabled) getParentElement())
                                        .getConversationHolder();
                if (getParentElement() instanceof IConversationEnabled) {
                        return ((IConversationEnabled) getParentElement())
                                        .getConversationHolder();
@@ -296,6 +298,7 @@ public abstract class AbstractCdmDetailElement<T> extends
        }
 
        /** {@inheritDoc} */
        }
 
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {
        }
 }
        }
 }
index 166e59d9349625273436f287afe5c08584b6543c..86dbf40e53f3f952c8e3e5a87f057dbf088b92a4 100644 (file)
@@ -110,15 +110,18 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSecti
         * @param style
         *            a int.
         */
         * @param style
         *            a int.
         */
-       protected void createControls(AbstractCdmDetailSection<ENTITY> formElement,
-                       int style) {
-               TableWrapLayout layout = (TableWrapLayout) getLayoutComposite()
-                               .getLayout();
+       protected void createControls(AbstractCdmDetailSection<ENTITY> formElement, int style) {
+        TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
                layout.topMargin = 10;
                layout.numColumns = 2;
 
                getLayoutComposite().setLayout(layout);
                layout.topMargin = 10;
                layout.numColumns = 2;
 
                getLayoutComposite().setLayout(layout);
-               detailElement = formFactory.createCdmDetailElement(getDetailType(), formElement, style);
+               detailElement = createCdmDetailElement(formElement, style);
+       }
+
+       //TODO: when all detail type enums are removed this can be abstract 
+       protected AbstractCdmDetailElement<ENTITY> createCdmDetailElement(AbstractCdmDetailSection<ENTITY> parentElement, int style){
+           return formFactory.createCdmDetailElement(getDetailType(), parentElement, style);
        }
 
        /**
        }
 
        /**
index 931596b948d31a3948500e29b39376b437794c9b..00731806d889888e85b672afb3dc51af56b429fb 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * 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.
 */
 * 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.
 */
@@ -15,8 +15,9 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +28,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
  * @version 1.0
  */
 public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
-       
+
        /**
         * <p>Constructor for DerivedUnitBaseDetailSection.</p>
         *
        /**
         * <p>Constructor for DerivedUnitBaseDetailSection.</p>
         *
@@ -42,7 +43,7 @@ public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<Deriv
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
         */
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
         */
@@ -60,4 +61,12 @@ public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<Deriv
        public String getHeading() {
                return "Specimen Details";
        }
        public String getHeading() {
                return "Specimen Details";
        }
+
+       /* (non-Javadoc)
+        * @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.createDerivedUnitBaseDetailElement(parentElement);
+       }
 }
 }
index bdd7200942a4f3d9c18e3ef6e903bb86a98e6aa3..036b660af24e3f2bb28111b132939095a21bc9ef 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * 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.
 */
 * 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.
 */
@@ -15,8 +15,9 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -52,7 +53,15 @@ public class DeterminationDetailSection extends AbstractCdmDetailSection<Derived
         */
        @Override
        public String getHeading() {
         */
        @Override
        public String getHeading() {
-               return "Determinations"; 
+               return "Determinations";
+       }
+
+       /* (non-Javadoc)
+        * @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.createDeterminationDetailElement(parentElement);
        }
 
 }
        }
 
 }
index 7869c7dcb5cd159b025fc5b3f5190eaa92c32e35..4abccf799060d904d944030e095783e0125facea 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * 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.
 */
 * 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.
 */
@@ -15,8 +15,9 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +28,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class FieldObservationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
  * @version 1.0
  */
 public class FieldObservationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
-       
+
        /**
         * <p>Constructor for FieldObservationDetailSection.</p>
         *
        /**
         * <p>Constructor for FieldObservationDetailSection.</p>
         *
@@ -42,7 +43,7 @@ public class FieldObservationDetailSection extends AbstractCdmDetailSection<Deri
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected DetailType getDetailType() {
        /** {@inheritDoc} */
        @Override
        protected DetailType getDetailType() {
@@ -54,4 +55,12 @@ public class FieldObservationDetailSection extends AbstractCdmDetailSection<Deri
        public String getHeading() {
                return "Field Observation Details";
        }
        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<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+           return formFactory.createFieldObservationDetailElement(parentElement);
+       }
 }
 }
index 9673eaa0ce9a57bfc6993e97c68800504c61dfd6..41a04b2da253ea9d6e889167a66ff3a6daaf85df 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * 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.
 */
 * 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.
 */
@@ -15,8 +15,9 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +28,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class GatheringEventDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
  * @version 1.0
  */
 public class GatheringEventDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
-       
+
        /**
         * <p>Constructor for GatheringEventDetailSection.</p>
         *
        /**
         * <p>Constructor for GatheringEventDetailSection.</p>
         *
@@ -42,8 +43,8 @@ public class GatheringEventDetailSection extends AbstractCdmDetailSection<Derive
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       
+
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
         */
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
         */
@@ -61,4 +62,12 @@ public class GatheringEventDetailSection extends AbstractCdmDetailSection<Derive
        public String getHeading() {
                return "Gathering Event Details";
        }
        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<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+           return formFactory.createGatheringEventDetailElement(parentElement);
+       }
 }
 }
index 10c56b57c5ae3788260e79f4bf4f587800a99e41..39004c3a9a50f092b90c6318c453a673215c91f3 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * 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.
 */
 * 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.
 */
@@ -15,8 +15,9 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -56,4 +57,12 @@ public class GeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFa
                return "General";
        }
 
                return "General";
        }
 
+       /* (non-Javadoc)
+        * @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.createGeneralDetailElement(parentElement);
+       }
+
 }
 }
index c292c7efc6823ca19121d5821f0303745da89616..521f6ddb28c055db8ae255c048efbd5a73ea2626 100644 (file)
@@ -600,40 +600,29 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createDerivedUnitBaseElementSection(RootElement parent) {
         destroySections();
 
     private void createDerivedUnitBaseElementSection(RootElement parent) {
         destroySections();
 
-        GeneralDetailSection generalDetailSection = (GeneralDetailSection) formFactory.createCdmDetailSection(
-                DetailType.DERIVED_UNIT_GENERAL, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
+        GeneralDetailSection generalDetailSection = formFactory.createGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        GatheringEventDetailSection gatheringEventDetailSection = (GatheringEventDetailSection) formFactory
-                .createCdmDetailSection(DetailType.GATHERING_EVENT, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE);
+        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        FieldObservationDetailSection fieldObservationDetailSection = (FieldObservationDetailSection) formFactory
-                .createCdmDetailSection(DetailType.FIELD_OBSERVATION, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE);
+        FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFieldObservationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = (DerivedUnitBaseDetailSection) formFactory
-                .createCdmDetailSection(DetailType.DERIVED_UNIT, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE);
+        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DeterminationDetailSection determinationDetailSection = (DeterminationDetailSection) formFactory
-                .createCdmDetailSection(DetailType.DETERMINATION, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE);
+        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         addPart(generalDetailSection);
         addPart(gatheringEventDetailSection);
         addPart(fieldObservationDetailSection);
         addPart(derivedUnitBaseDetailSection);
         addPart(determinationDetailSection);
 
         addPart(generalDetailSection);
         addPart(gatheringEventDetailSection);
         addPart(fieldObservationDetailSection);
         addPart(derivedUnitBaseDetailSection);
         addPart(determinationDetailSection);
-
     }
 
     /**
     }
 
     /**