- completely removed DetailType enum and all its uses
authorPatric Plitzner <p.plitzner@bgbm.org>
Thu, 18 Jul 2013 14:36:09 +0000 (14:36 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Thu, 18 Jul 2013 14:36:09 +0000 (14:36 +0000)
59 files changed:
.gitattributes
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/PolytomousKeyWizardPage.java
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/AbstractCdmDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamOrPersonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferenceEntityDetailElement.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/RefereneEntityDetailElement.java with 91% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferencedEntityDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/NaturalLanguageSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectionWizardPage.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/DerivedUnitBaseWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailSection.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/FieldObservationWizardPage.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/GatheringEventWizardPage.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/ui/section/occurrence/GeneralWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalReferenceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/ParsingMessagesSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaLevelDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index ebec2033fd52e767f387b1570f1b13936768ac94..0689b0531a2409510d6bcd97b1d2cb387e189d6e 100644 (file)
@@ -1331,8 +1331,8 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/cla
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailSection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferenceEntityDetailElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferencedEntityDetailSection.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/RefereneEntityDetailElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DerivedUnitElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescribedSpecimenSection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailElement.java -text
index 7738eed49fceb57a5cbb0d1b7558de2995341e13..c4248413cede4919ff5940f006c0588161632b9d 100644 (file)
@@ -1,16 +1,13 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailElement;
 
@@ -27,12 +24,12 @@ public class PolytomousKeyWizardPage extends AbstractCdmEntityWizardPage<Polytom
 
        @Override
        public AbstractCdmDetailElement createElement(ICdmFormElement rootElement) {
-               PolytomousKeyDetailElement element = (PolytomousKeyDetailElement) formFactory.createCdmDetailElement(DetailType.POLYTOMOUS_KEY, rootElement, SWT.NULL);
+               PolytomousKeyDetailElement element = formFactory.createPolytomousKeyDetailElement(rootElement);
                element.setEntity(entity);
                setPageComplete(true);
                return element;
        }
-       
+
        public String getPolytomousKeyName() {
            return ((PolytomousKeyDetailElement) getDetailElement()).getText();
        }
index 534b93d32bed93c58e9a28d9c49c3ad83535b403..822f70e6349aee41a6cf8693172c340cce3cb6a5 100644 (file)
@@ -118,8 +118,8 @@ import eu.etaxonomy.taxeditor.ui.section.classification.ClassificationDetailElem
 import eu.etaxonomy.taxeditor.ui.section.classification.ClassificationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.common.ReferenceEntityDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.common.RefereneEntityDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.description.DerivedUnitElement;
 import eu.etaxonomy.taxeditor.ui.section.description.DescribedSpecimenSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailElement;
@@ -1314,56 +1314,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    // SIMPLIFY
-
-    /**
-     * Used to define which {@link AbstractCdmDetailSection} or
-     * {@link AbstractCdmDetailElement} should be created with
-     * {@link CdmFormFactory#createCdmDetailSection(DetailType, ConversationHolder, ICdmFormElement, ISelectionProvider, int)}
-     * or
-     * {@link CdmFormFactory#createCdmDetailElement(DetailType, ICdmFormElement, int)}
-     */
-    public static enum DetailType {
-        AUTHORSHIP,
-        CLASSIFICATION,
-        COLLECTION,
-        DERIVED_UNIT,
-        DERIVED_UNIT_FACADE,
-        DERIVED_UNIT_GENERAL,
-        DESCRIPTION,
-        DESCRIPTIONELEMENT,
-        DETERMINATION,
-        FEATURE_DISTRIBUTION,
-        FIELD_OBSERVATION,
-        GATHERING_EVENT,
-        GRANTEDAUTHORITY,
-        GROUP,
-        HYBRID,
-        INSTITUTION,
-        MEDIA,
-        NAMED_AREA,
-        NAMED_AREA_LEVEL,
-        NAMERELATIONSHIP,//never used
-        NATURAL_LANGUAGE,
-        NOMENCLATURALREFERENCE,
-        NONVIRALNAME,
-        PARSINGMESSAGE,
-        PERSON,
-        POLYTOMOUS_KEY,
-        POLYTOMOUS_KEY_NODE,
-        REFERENCEBASE,
-        REFERENCED_ENTITY,
-        SCIENTIFICNAME,
-        TAXON_NODE,
-        TAXON_RELATIONSHIP,
-        TAXONBASE,
-        TEAM,
-        TEAMORPERSONBASE,
-        TERM_VOCABULARY,
-        USE_RECORD,
-        USER
-    }
-
     public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass, ConversationHolder conversation,
             ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
 
@@ -1382,8 +1332,7 @@ 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)) {
@@ -1397,543 +1346,437 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * <p>
-     * createCdmDetailSection
-     * </p>
-     *
-     * @param detailType
-     *            a
-     *            {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
-     *            object.
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param selectionProvider
-     *            a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
-     * @param style
-     *            a int.
-     * @param conversation
-     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-     *            object.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-     *         object.
-     */
-    public AbstractFormSection createCdmDetailSection(DetailType detailType, ConversationHolder conversation,
-            ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-        AbstractFormSection section = null;
-
-        switch (detailType) {
-        case SCIENTIFICNAME:
-            section = new NameDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case REFERENCEBASE:
-            section = new ReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case NOMENCLATURALREFERENCE:
-            section = new NomenclaturalReferenceDetailSection(this, conversation, parentElement, selectionProvider,
-                    style);
-            break;
-        case TAXONBASE:
-            section = new TaxonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case AUTHORSHIP:
-            section = new AuthorshipDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case TEAMORPERSONBASE:
-            section = new TeamOrPersonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case TEAM:
-            section = new TeamDetailSection(this, conversation, parentElement, null, style);
-            break;
-        case PERSON:
-            section = new PersonDetailSection(this, conversation, parentElement, null, style);
-            break;
-        case DESCRIPTION:
-            section = new DescriptionDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case DESCRIPTIONELEMENT:
-            section = new DescriptionElementDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case PARSINGMESSAGE:
-            section = new ParsingMessagesSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case NONVIRALNAME:
-            section = new NonViralNameDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case MEDIA:
-            section = new eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection(this, conversation,
-                    parentElement, selectionProvider, style);
-            break;
-        case DERIVED_UNIT_FACADE:
-            section = new DerivedUnitFacadeDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case FIELD_OBSERVATION:
-            section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case GATHERING_EVENT:
-            section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case DERIVED_UNIT:
-            section = new DerivedUnitBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case NATURAL_LANGUAGE:
-            section = new NaturalLanguageSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case FEATURE_DISTRIBUTION:
-            section = new FeatureDistributionDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case CLASSIFICATION:
-            section = new ClassificationDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case TAXON_NODE:
-            section = new TaxonNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case POLYTOMOUS_KEY:
-            section = new PolytomousKeyDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case POLYTOMOUS_KEY_NODE:
-            section = new PolytomousKeyNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case INSTITUTION:
-            section = new InstitutionDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case DERIVED_UNIT_GENERAL:
-            section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case HYBRID:
-            section = new HybridDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case USER:
-            section = new UserDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case GROUP:
-            section = new GroupDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case DETERMINATION:
-            section = new DeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case TAXON_RELATIONSHIP:
-            section = new TaxonRelationshipDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case REFERENCED_ENTITY:
-            section = new ReferencedEntityDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case TERM_VOCABULARY:
-            section = new TermVocabularyDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case NAMED_AREA:
-            section = new NamedAreaDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        case USE_RECORD:
-            section = new UseRecordDetailSection(this, conversation, parentElement, selectionProvider, style);
-            break;
-        }
-
-        if (section == null) {
-            throw new RuntimeException("You tried to create a cdm detail section that is not implemented yet.");
-        }
-
-        parentElement.addElement(section);
-        adapt(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        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);
-        addAndAdapt(parentElement, section);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        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);
-        addAndAdapt(parentElement, section);
+        addAndAdaptSection(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);
+        addAndAdaptSection(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);
+        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);
-        addAndAdapt(parentElement, section);
+        addAndAdaptSection(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;
+        FieldObservationDetailSection section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
     }
 
-    private void addAndAdapt(ICdmFormElement parentElement, AbstractFormSection<?> section) {
+    private void addAndAdaptSection(ICdmFormElement parentElement, AbstractFormSection<?> section) {
         parentElement.addElement(section);
         adapt(section);
     }
 
 
-    /**
-     * <p>
-     * createCdmDetailElement
-     * </p>
-     *
-     * @param detailType
-     *            a
-     *            {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
-     *            object.
-     * @param style
-     *            a int.
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @return a
-     *         {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement}
-     *         object.
-     */
-    public AbstractCdmDetailElement createCdmDetailElement(DetailType detailType, ICdmFormElement parentElement, int style) {
-        AbstractCdmDetailElement element = null;
+    public UseRecordDetailElement createUseRecordDetailElement(ICdmFormElement parentElement){
+        UseRecordDetailElement element = new UseRecordDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
 
-        switch (detailType) {
-        case SCIENTIFICNAME:
-            element = new NameDetailElement(this, parentElement, style);
-            break;
-        case REFERENCEBASE:
-            element = new ReferenceDetailElement(this, parentElement, style);
-            break;
-        case NOMENCLATURALREFERENCE:
-            element = new NomenclaturalReferenceDetailElement(this, parentElement, style);
-            break;
-        case TAXONBASE:
-            element = new TaxonBaseDetailElement(this, parentElement, style);
-            break;
-        case AUTHORSHIP:
-            element = new AuthorshipDetailElement(this, parentElement, style);
-            break;
-        case TEAM:
-            element = new TeamDetailElement(this, parentElement, style);
-            break;
-        case PERSON:
-            element = new PersonDetailElement(this, parentElement, style);
-            break;
-        case DESCRIPTION:
-            element = new DescriptionDetailElement(this, parentElement, style);
-            break;
-        case DESCRIPTIONELEMENT:
-            element = new DescriptionElementDetailElement(this, parentElement, style);
-            break;
-        case NONVIRALNAME:
-            element = new NonViralNameDetailElement(this, parentElement);
-            break;
-        case DERIVED_UNIT_FACADE:
-            element = new DerivedUnitFacadeDetailElement(this, parentElement);
-            break;
-        case FIELD_OBSERVATION:
-            element = new FieldObservationDetailElement(this, parentElement);
-            break;
-        case GATHERING_EVENT:
-            element = new GatheringEventDetailElement(this, parentElement);
-            break;
-        case DERIVED_UNIT:
-            element = new DerivedUnitBaseDetailElement(this, parentElement);
-            break;
-        case NATURAL_LANGUAGE:
-            element = new NaturalLanguageDetailElement(this, parentElement);
-            break;
-        case FEATURE_DISTRIBUTION:
-            element = new FeatureDistributionDetailElement(this, parentElement);
-            break;
-        case CLASSIFICATION:
-            element = new ClassificationDetailElement(this, parentElement);
-            break;
-        case TAXON_NODE:
-            element = new TaxonNodeDetailElement(this, parentElement);
-            break;
-        case COLLECTION:
-            element = new CollectionDetailElement(this, parentElement);
-            break;
-        case POLYTOMOUS_KEY:
-            element = new PolytomousKeyDetailElement(this, parentElement);
-            break;
-        case POLYTOMOUS_KEY_NODE:
-            element = new PolytomousKeyNodeDetailElement(this, parentElement);
-            break;
-        case INSTITUTION:
-            element = new InstitutionDetailElement(this, parentElement);
-            break;
-        case DERIVED_UNIT_GENERAL:
-            element = new GeneralDetailElement(this, parentElement);
-            break;
-        case HYBRID:
-            element = new HybridDetailElement(this, parentElement);
-            break;
-        case USER:
-            element = new UserDetailElement(this, parentElement);
-            break;
-        case GROUP:
-            element = new GroupDetailElement(this, parentElement);
-            break;
-        case GRANTEDAUTHORITY:
-            element = new GrantedAuthorityDetailElement(this, parentElement);
-            break;
-        case DETERMINATION:
-            element = new DeterminationDetailElement(this, parentElement);
-            break;
-        case TAXON_RELATIONSHIP:
-            element = new TaxonRelationshipDetailElement(this, parentElement);
-            break;
-        case REFERENCED_ENTITY:
-            element = new RefereneEntityDetailElement(this, parentElement);
-            break;
-        case TERM_VOCABULARY:
-            element = new TermVocabularyDetailElement(this, parentElement);
-            break;
-        case NAMED_AREA:
-            element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
-            break;
-        case NAMED_AREA_LEVEL:
-            element = new DefinedTermDetailElement<NamedAreaLevel>(this, parentElement);
-            break;
-        case USE_RECORD:
-            // element = new UseRecordDetailElement(this, parentElement, style);
-            element = new UseRecordDetailElement(this, parentElement);
-            break;
-        }
+    public DefinedTermDetailElement<NamedAreaLevel> createNamedAreaLevelElement(ICdmFormElement parentElement){
+        DefinedTermDetailElement<NamedAreaLevel> element = new DefinedTermDetailElement<NamedAreaLevel>(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
 
-        if (element == null) {
-            AbstractUtility.error(this.getClass(),
-                    "Detail element was not created. Seems like the case was not implemented for the requested detail type: "
-                            + detailType, null);
-        }
+    public eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement createNamedAreaDetailElement(ICdmFormElement parentElement){
+        eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
 
-        adapt(element);
-        parentElement.addElement(element);
+    public TermVocabularyDetailElement createTermVocabularyDetailElement(ICdmFormElement parentElement){
+        TermVocabularyDetailElement element = new TermVocabularyDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public ReferenceEntityDetailElement createReferenceEntityDetailElement(ICdmFormElement parentElement){
+        ReferenceEntityDetailElement element = new ReferenceEntityDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TaxonRelationshipDetailElement createTaxonRelationshipDetailElement(ICdmFormElement parentElement){
+        TaxonRelationshipDetailElement element = new TaxonRelationshipDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public GrantedAuthorityDetailElement createGrantedAuthorityDetailElement(ICdmFormElement parentElement){
+        GrantedAuthorityDetailElement element = new GrantedAuthorityDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public GroupDetailElement createGroupDetailElement(ICdmFormElement parentElement){
+        GroupDetailElement element = new GroupDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public UserDetailElement createUserDetailElement(ICdmFormElement parentElement){
+        UserDetailElement element = new UserDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public HybridDetailElement createHybridDetailElement(ICdmFormElement parentElement){
+        HybridDetailElement element = new HybridDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public InstitutionDetailElement createInstitutionDetailElement(ICdmFormElement parentElement){
+        InstitutionDetailElement element = new InstitutionDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PolytomousKeyNodeDetailElement createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement){
+        PolytomousKeyNodeDetailElement element = new PolytomousKeyNodeDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PolytomousKeyDetailElement createPolytomousKeyDetailElement(ICdmFormElement parentElement){
+        PolytomousKeyDetailElement element = new PolytomousKeyDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public CollectionDetailElement createCollectionDetailElement(ICdmFormElement parentElement){
+        CollectionDetailElement element = new CollectionDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TaxonNodeDetailElement createTaxonNodeDetailElement(ICdmFormElement parentElement){
+        TaxonNodeDetailElement element = new TaxonNodeDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public ClassificationDetailElement createClassificationDetailElement(ICdmFormElement parentElement){
+        ClassificationDetailElement element = new ClassificationDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public FeatureDistributionDetailElement createFeatureDistributionDetailElement(ICdmFormElement parentElement){
+        FeatureDistributionDetailElement element = new FeatureDistributionDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NaturalLanguageDetailElement createNaturalLanguageDetailElement(ICdmFormElement parentElement){
+        NaturalLanguageDetailElement element = new NaturalLanguageDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DerivedUnitFacadeDetailElement createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement){
+        DerivedUnitFacadeDetailElement element = new DerivedUnitFacadeDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NonViralNameDetailElement createNonViralNameDetailElement(ICdmFormElement parentElement){
+        NonViralNameDetailElement element = new NonViralNameDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DescriptionElementDetailElement createDescriptionElementDetailElement(ICdmFormElement parentElement, int style){
+        DescriptionElementDetailElement element = new DescriptionElementDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DescriptionDetailElement createDescriptionDetailElement(ICdmFormElement parentElement, int style){
+        DescriptionDetailElement element = new DescriptionDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PersonDetailElement createPersonDetailElement(ICdmFormElement parentElement, int style){
+        PersonDetailElement element = new PersonDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TeamDetailElement createTeamDetailElement(ICdmFormElement parentElement, int style){
+        TeamDetailElement element = new TeamDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public AuthorshipDetailElement createAuthorshipDetailElement(ICdmFormElement parentElement, int style){
+        AuthorshipDetailElement element = new AuthorshipDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
         return element;
     }
 
+    public TaxonBaseDetailElement createTaxonBaseDetailElement(ICdmFormElement parentElement, int style){
+        TaxonBaseDetailElement element = new TaxonBaseDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NameDetailElement createNameDetailElement(ICdmFormElement parentElement, int style){
+        NameDetailElement element = new NameDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style){
+        ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NomenclaturalReferenceDetailElement createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement, int style){
+        NomenclaturalReferenceDetailElement element = new NomenclaturalReferenceDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+
     public GeneralDetailElement createGeneralDetailElement(ICdmFormElement parentElement){
         GeneralDetailElement element = new GeneralDetailElement(this, parentElement);
-        addAndAdapt(parentElement, element);
+        addAndAdaptElement(parentElement, element);
         return element;
     }
 
     public GatheringEventDetailElement createGatheringEventDetailElement(ICdmFormElement parentElement) {
         GatheringEventDetailElement element = new GatheringEventDetailElement(this, parentElement);
-        addAndAdapt(parentElement, element);
+        addAndAdaptElement(parentElement, element);
         return element;
     }
 
     public FieldObservationDetailElement createFieldObservationDetailElement(ICdmFormElement parentElement) {
         FieldObservationDetailElement element = new FieldObservationDetailElement(this, parentElement);
-        addAndAdapt(parentElement, element);
+        addAndAdaptElement(parentElement, element);
         return element;
     }
 
     public DerivedUnitBaseDetailElement createDerivedUnitBaseDetailElement(ICdmFormElement parentElement) {
         DerivedUnitBaseDetailElement element = new DerivedUnitBaseDetailElement(this, parentElement);
-        addAndAdapt(parentElement, element);
+        addAndAdaptElement(parentElement, element);
         return element;
     }
 
     public DeterminationDetailElement createDeterminationDetailElement(ICdmFormElement parentElement) {
         DeterminationDetailElement element = new DeterminationDetailElement(this, parentElement);
-        addAndAdapt(parentElement, element);
+        addAndAdaptElement(parentElement, element);
         return element;
     }
 
@@ -1941,7 +1784,7 @@ public class CdmFormFactory extends FormToolkit {
      * @param parentElement
      * @param element
      */
-    private void addAndAdapt(ICdmFormElement parentElement, AbstractCdmDetailElement<?> element) {
+    private void addAndAdaptElement(ICdmFormElement parentElement, AbstractCdmDetailElement<?> element) {
         adapt(element);
         parentElement.addElement(element);
     }
index 86dbf40e53f3f952c8e3e5a87f057dbf088b92a4..ee222adad8914b47c7c1daafd4e324e88cfd723b 100644 (file)
@@ -24,7 +24,6 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
 import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
@@ -40,7 +39,7 @@ import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
  */
 public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSection<ENTITY> implements IEnableableFormElement, IExpansionListener {
 
-       protected AbstractCdmDetailElement<ENTITY> detailElement;
+       private AbstractCdmDetailElement<ENTITY> detailElement;
 
        /**
         * <p>
@@ -66,27 +65,26 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSecti
        public AbstractCdmDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, parentElement, selectionProvider,
-                               ExpandableComposite.CLIENT_INDENT | style);
-
-               setText(getHeading());
-
-               addExpansionListener(this);
-
-               createControls(this, SWT.NULL);
+           this(formFactory, null, conversation, parentElement, selectionProvider, style);
        }
 
+
        public AbstractCdmDetailSection(CdmFormFactory formFactory, Class<ENTITY> clazz,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, parentElement, selectionProvider,
                                ExpandableComposite.CLIENT_INDENT | style);
 
-               setText(getHeading());
+        setText(getHeading());
 
-               addExpansionListener(this);
+        addExpansionListener(this);
 
-               createControlsByType(this, clazz, SWT.NULL);
+        if(clazz==null){
+            createControls(this, style);
+        }
+        else{
+            createControlsByType(this, clazz, SWT.NULL);
+        }
        }
 
        /**
@@ -94,7 +92,18 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSecti
         * @param definedTermClass
         * @param null1
         */
-       protected void createControlsByType(AbstractCdmDetailSection<ENTITY> abstractCdmDetailSection, Class<ENTITY> entityClass, int style) {
+       protected void createControlsByType(AbstractCdmDetailSection<ENTITY> formElement, Class<ENTITY> entityClass, int style) {
+           TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
+           layout.topMargin = 10;
+           layout.numColumns = 2;
+
+           getLayoutComposite().setLayout(layout);
+           if(entityClass==null){
+               detailElement = createCdmDetailElement(formElement, style);
+           }
+           else{
+               detailElement = createCdmDetailElementByType(formElement, entityClass, style);
+           }
        }
 
 
@@ -111,29 +120,14 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSecti
         *            a int.
         */
        protected void createControls(AbstractCdmDetailSection<ENTITY> formElement, int style) {
-        TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
-               layout.topMargin = 10;
-               layout.numColumns = 2;
-
-               getLayoutComposite().setLayout(layout);
-               detailElement = createCdmDetailElement(formElement, style);
+           createControlsByType(formElement, null, 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);
-       }
+       protected abstract AbstractCdmDetailElement<ENTITY> createCdmDetailElement(AbstractCdmDetailSection<ENTITY> parentElement, int style);
 
-       /**
-        * <p>
-        * getDetailType
-        * </p>
-        *
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
-        *         object.
-        */
-       protected abstract DetailType getDetailType();
+       protected AbstractCdmDetailElement<ENTITY> createCdmDetailElementByType(AbstractCdmDetailSection<ENTITY> parentElement, Class<ENTITY> entityClass, int style){
+           return createCdmDetailElement(parentElement, style);
+       }
 
        /**
         * <p>
index bf510748c0b7c858abd7e245e24067f9e48c27e2..11e4a2d99af794295747a17584dc4f846b11d83e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Institution;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -40,19 +40,19 @@ public class InstitutionDetailSection extends AbstractCdmDetailSection<Instituti
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.INSTITUTION;
+       public String getHeading() {
+               return "Institution";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Institution";
+       protected AbstractCdmDetailElement<Institution> createCdmDetailElement(AbstractCdmDetailSection<Institution> parentElement, int style) {
+           return formFactory.createInstitutionDetailElement(parentElement);
        }
 
 }
index 0c0656b635378414d3715fd4942d840c15d77104..5f4933cba4ef5653106741682ffa7cff0b7fa144 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
 
 package eu.etaxonomy.taxeditor.ui.section.agent;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -38,19 +35,17 @@ public class InstitutionWizardPage extends
                super(formFactory, conversation, entity);
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
-        * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
-       @Override
-       public AbstractCdmDetailElement<Institution> createElement(ICdmFormElement rootElement) {
-               InstitutionDetailElement detailElement = (InstitutionDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.INSTITUTION, rootElement,
-                                               SWT.NULL);
-               detailElement.setEntity(entity);
-               return detailElement;
-       }
+           /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
+     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+     */
+    @Override
+    public AbstractCdmDetailElement<Institution> createElement(ICdmFormElement rootElement) {
+        InstitutionDetailElement detailElement = formFactory.createInstitutionDetailElement(rootElement);
+        detailElement.setEntity(entity);
+        return detailElement;
+    }
 }
index 77e6277e6f8c7b9a549815400891b68fdc54bc6b..7821e7a022f15efce0702bd700fceb240d782704 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Person;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -44,13 +44,15 @@ public class PersonDetailSection extends AbstractCdmDetailSection<Person>{
 
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.PERSON;
+       public String getHeading() {
+               return "Person";
        }
 
-       /** {@inheritDoc} */
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       public String getHeading() {
-               return "Person";
+       protected AbstractCdmDetailElement<Person> createCdmDetailElement(AbstractCdmDetailSection<Person> parentElement, int style) {
+           return formFactory.createPersonDetailElement(parentElement, style);
        }
 }
index 75fecc33702b2672c26efc3af81e6e899037340c..51ab6ad03799fdf66dd1a567339f3e14664e2b5f 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,7 +17,6 @@ import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
@@ -41,15 +40,15 @@ public class PersonWizardPage extends AbstractCdmEntityWizardPage<Person> {
                super(formFactory, conversation, entity);
                setTitle("Person");
        }
-       
-       
+
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<Person> createElement(ICdmFormElement rootElement) {
-               PersonDetailElement personElement = (PersonDetailElement) formFactory.createCdmDetailElement(DetailType.PERSON, rootElement, SWT.NULL);
+               PersonDetailElement personElement = formFactory.createPersonDetailElement(rootElement, SWT.NULL);
                personElement.setEntity(entity);
                return personElement;
        }
index 8752f86de666a2aff7f3ab8144f93168040c94e7..bacd6b548cd6c0302b89f23d542d7cb7710aab4b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Team;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -44,13 +44,15 @@ public class TeamDetailSection extends AbstractCdmDetailSection<Team>{
 
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.TEAM;
+       public String getHeading() {
+               return "Team";
        }
 
-       /** {@inheritDoc} */
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       public String getHeading() {
-               return "Team";
+       protected AbstractCdmDetailElement<Team> createCdmDetailElement(AbstractCdmDetailSection<Team> parentElement, int style) {
+           return formFactory.createTeamDetailElement(parentElement, style);
        }
 }
index 77808b23d48950f7a7534cdbee30827db98923b7..578d220b26eb28124b25f57d5de3464f09d6daec 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,9 +16,10 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-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;
 
 /**
@@ -43,12 +44,6 @@ public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<Team
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.TEAMORPERSONBASE;
-       }
 
        /** {@inheritDoc} */
        @Override
@@ -62,4 +57,14 @@ public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<Team
                }
                return "Team or Person";
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<TeamOrPersonBase> createCdmDetailElement(AbstractCdmDetailSection<TeamOrPersonBase> parentElement, int style) {
+           AbstractUtility.error(this.getClass(), "Detail element was not created. Seems like the case was not implemented for TeamOrPersonBaseDetailSection", null);
+           //TODO DetailElement missing??
+           return null;
+       }
 }
index bbabd642afbab04ce72d0afd09ebdc33b665bfb0..9016f92c6e2a4a41dba32c84e313d2fd2e35ac00 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -17,14 +17,13 @@ import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
  * <p>
  * TeamWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Jun 1, 2010
  * @version 1.0
@@ -35,7 +34,7 @@ public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
         * <p>
         * Constructor for TeamWizardPage.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -55,8 +54,7 @@ public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
        @Override
        public AbstractCdmDetailElement<Team> createElement(
                        ICdmFormElement rootElement) {
-               TeamDetailElement teamElement = (TeamDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.TEAM, rootElement, SWT.NULL);
+               TeamDetailElement teamElement = formFactory.createTeamDetailElement(rootElement, SWT.NULL);
                teamElement.setEntity(entity);
                return teamElement;
        }
index c3e67fe2e0d7bd2e16156e388b900b0279b43b9b..83eb7ee1543bc44d79ab2e0a10cba1e9e8f25091 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class ClassificationDetailSection extends AbstractCdmDetailSection<Classification> {
-       
+
        /**
         * <p>Constructor for ClassificationDetailSection.</p>
         *
@@ -42,7 +42,7 @@ public class ClassificationDetailSection extends AbstractCdmDetailSection<Classi
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean)
         */
@@ -53,20 +53,19 @@ public class ClassificationDetailSection extends AbstractCdmDetailSection<Classi
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
+       public String getHeading() {
                return null;
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return null;
+       protected AbstractCdmDetailElement<Classification> createCdmDetailElement(AbstractCdmDetailSection<Classification> parentElement, int style) {
+           return formFactory.createClassificationDetailElement(parentElement);
        }
 }
index 0f47182680bca1f9d9c8f0c1a7a006363abedc37..292916ba5399d68ef0a64cf66229bf2044bff306 100644 (file)
@@ -1,29 +1,26 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
 
 package eu.etaxonomy.taxeditor.ui.section.classification;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
 /**
  * <p>
  * ClassificationWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created 23.06.2009
  * @version 1.0
@@ -35,7 +32,7 @@ public class ClassificationWizardPage extends
         * <p>
         * Constructor for ClassificationWizardPage.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -49,24 +46,22 @@ public class ClassificationWizardPage extends
                        ConversationHolder conversation, Classification entity) {
                super(formFactory, conversation, entity);
                setTitle("Classification");
-               
-       }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
-        * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public ClassificationDetailElement createElement(ICdmFormElement rootElement) {
-               ClassificationDetailElement detailElement = (ClassificationDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.CLASSIFICATION, rootElement,
-                                               SWT.NULL);
-               detailElement.setEntity(getEntity());           
-               return detailElement;
        }
-       
+
+           /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
+     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public ClassificationDetailElement createElement(ICdmFormElement rootElement) {
+        ClassificationDetailElement detailElement = formFactory.createClassificationDetailElement(rootElement);
+        detailElement.setEntity(getEntity());
+        return detailElement;
+    }
+
 }
index 1460d9330e1d2d99e3b04d28ff15a3703cebed95..0508372da8f9116d5969f55247edc163ecfced5b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,16 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class TaxonNodeDetailSection extends AbstractCdmDetailSection<TaxonNode> {
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return null;
-       }
-       
+
        /**
         * <p>Constructor for TaxonNodeDetailSection.</p>
         *
@@ -60,4 +51,13 @@ public class TaxonNodeDetailSection extends AbstractCdmDetailSection<TaxonNode>
        public String getHeading() {
                return null;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<TaxonNode> parentElement, int style) {
+           //FIXME generic
+           return formFactory.createTaxonNodeDetailElement(parentElement);
+       }
 }
index 4db6c49fc5f547c725ac36cb7fa11dbe93f2af18..4f261d545aa00361064feb154708d8f54072bfac 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -11,7 +11,6 @@
 package eu.etaxonomy.taxeditor.ui.section.classification;
 
 import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
@@ -19,13 +18,12 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 
 /**
  * <p>
  * TaxonNodeWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Sep 15, 2009
  * @version 1.0
@@ -36,7 +34,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
         * <p>
         * Constructor for TaxonNodeWizardPage.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -54,7 +52,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
         * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
@@ -63,9 +61,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
        @Override
        public TaxonNodeDetailElement createElement(ICdmFormElement rootElement) {
 
-               TaxonNodeDetailElement detailElement = (TaxonNodeDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.TAXON_NODE, rootElement,
-                                               SWT.NULL);
+        TaxonNodeDetailElement detailElement = formFactory.createTaxonNodeDetailElement(rootElement);
                detailElement.setEntity(entity);
                formFactory.addPropertyChangeListener(this);
                return detailElement;
@@ -75,7 +71,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
         * <p>
         * openInEditor
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        public boolean openInEditor() {
@@ -84,7 +80,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
         * .jface.util.PropertyChangeEvent)
@@ -98,7 +94,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
        }
 
        /**
-        * 
+        *
         */
        @Override
        protected void checkComplete() {
@@ -119,7 +115,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
         * <p>
         * Getter for the field <code>parentTreeNode</code>.
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.model.taxon.ITreeNode} object.
         */
        public ITreeNode getParentTreeNode() {
@@ -133,7 +129,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#dispose()
         */
        /** {@inheritDoc} */
@@ -22,12 +22,12 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @date Dec 1, 2011
  *
  */
-public class RefereneEntityDetailElement extends AbstractCdmDetailElement<ReferencedEntityBase>{
+public class ReferenceEntityDetailElement extends AbstractCdmDetailElement<ReferencedEntityBase>{
 
        private EntitySelectionElement<Reference> selection_reference;
        private TextWithLabelElement text_referenceDetail;
 
-       public RefereneEntityDetailElement(CdmFormFactory formFactory,
+       public ReferenceEntityDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
index f0ade829c97b042a644dcadb8fba674f48a620c3..d9825324dff6423943b6b543588cd228aefa1152 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -31,15 +31,17 @@ public class ReferencedEntityDetailSection extends AbstractCdmDetailSection<Refe
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.REFERENCED_ENTITY;
-       }
-
        @Override
        public String getHeading() {
                return "Reference";
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<ReferencedEntityBase> createCdmDetailElement(AbstractCdmDetailSection<ReferencedEntityBase> parentElement, int style) {
+           return formFactory.createReferenceEntityDetailElement(parentElement);
+       }
 
 }
index 569ebb9b78584a2c62e3f56b59d962b2042a87d9..5cf40dc83b3e5e65939178f357045eb172601438 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,8 +15,8 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-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;
 
 /**
@@ -40,18 +40,20 @@ public class DescriptionDetailSection extends AbstractCdmDetailSection<Descripti
        public DescriptionDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
-               
+
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Description";
        }
 
-       /** {@inheritDoc} */
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.DESCRIPTION;
+       protected AbstractCdmDetailElement<DescriptionBase> createCdmDetailElement(AbstractCdmDetailSection<DescriptionBase> parentElement, int style) {
+           return formFactory.createDescriptionDetailElement(parentElement, style);
        }
 }
index 8f43590dd54e9dec345fa2e0bd42c810f92a9dcd..2fe95883904f4c6b43a56b3bf15e2627354f3666 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -22,8 +22,8 @@ import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-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.description.operation.ChangeDescriptionElementType;
 
@@ -36,7 +36,7 @@ import eu.etaxonomy.taxeditor.ui.section.description.operation.ChangeDescription
  */
 public class DescriptionElementDetailSection extends
                AbstractCdmDetailSection<DescriptionElementBase> {
-       
+
        /**
         * <p>Constructor for DescriptionElementDetailSection.</p>
         *
@@ -50,19 +50,20 @@ public class DescriptionElementDetailSection extends
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       
-       protected Control createToolbar() {
+
+
+       @Override
+    protected Control createToolbar() {
                if(! hasSpecificElement()){
                        return null;
                }
-               
+
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-               
+
                final String destinationString = (getEntity() instanceof TextData) ? "the specific element" : "free text";
-               
-               final String label = "Change to " + destinationString; 
-               
+
+               final String label = "Change to " + destinationString;
+
                Action addAction = new Action("Change Type", Action.AS_PUSH_BUTTON) {
                        /* (non-Javadoc)
                         * @see org.eclipse.jface.action.Action#run()
@@ -73,52 +74,54 @@ public class DescriptionElementDetailSection extends
                                                + destinationString + "? Current data will be lost.");
                                if (confirmed) {
                                        // FIXME
-                                       ChangeDescriptionElementType operation = new ChangeDescriptionElementType(label, 
+                                       ChangeDescriptionElementType operation = new ChangeDescriptionElementType(label,
                                                        getEntity(), StoreUtil.getDetailsView(), StoreUtil.getUndoContext());
                                        StoreUtil.executeOperation(operation);
                                }
                        }
                };
-               // TODO enable this once a proper icon has been found 
+               // TODO enable this once a proper icon has been found
 //             addAction.setImageDescriptor(new ImageDescriptor() {
-//                     
+//
 //                     @Override
 //                     public ImageData getImageData() {
 //                             return ImageResources.getImage(ImageResources.ADD_ICON).getImageData();
 //                     }
 //             });
                addAction.setToolTipText(label);
-               
+
                toolBarManager.add(addAction);
-               
+
                return toolBarManager.createControl(this);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Description Element";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.DESCRIPTIONELEMENT;
-       }
-       
        /** {@inheritDoc} */
        @Override
        protected void setSectionTitle() {
                this.setText(getHeading() + ": " + getEntity().getFeature().getLabel(CdmStore.getDefaultLanguage()));
                setTextClient(createToolbar());
        }
-       
+
        private boolean hasSpecificElement(){
-               return  getEntity().getFeature().isSupportsCategoricalData() 
+               return  getEntity().getFeature().isSupportsCategoricalData()
                                || getEntity().getFeature().isSupportsCommonTaxonName()
                                || getEntity().getFeature().isSupportsDistribution()
                                || getEntity().getFeature().isSupportsIndividualAssociation()
                                || getEntity().getFeature().isSupportsQuantitativeData()
                                || getEntity().getFeature().isSupportsTaxonInteraction();
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<DescriptionElementBase> createCdmDetailElement(AbstractCdmDetailSection<DescriptionElementBase> parentElement, int style) {
+           return formFactory.createDescriptionElementDetailElement(parentElement, style);
+       }
 }
index f82b59c3ce15d818c97ef1e5dc2ce8cf6d56416a..04a0171b1b7d09d74d1626003dbcb9aff67498a5 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,8 +17,8 @@ import org.eclipse.ui.forms.widgets.TableWrapLayout;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-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.media.MediaElement;
 
@@ -47,16 +47,7 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return null;
-       }
-       
+
        /** {@inheritDoc} */
        @Override
        protected void createControls(AbstractCdmDetailSection formElement,
@@ -64,18 +55,19 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
                TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
                layout.topMargin = 10;
                layout.numColumns = 2;
-               
+
                getLayoutComposite().setLayout(layout);
-               
-               
+
+
        }
-       
+
        /**
         * <p>setEntity</p>
         *
         * @param entity a {@link eu.etaxonomy.cdm.model.media.Media} object.
         */
-       public void setEntity(Media entity) {
+       @Override
+    public void setEntity(Media entity) {
                if(element_media != null){
                        this.removeElements();
                }
@@ -94,4 +86,12 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
        public String getHeading() {
                return "Image";
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<Media> createCdmDetailElement(AbstractCdmDetailSection<Media> parentElement, int style) {
+           return null;
+       }
 }
index e073f7e3a38aeaea89c675187e88e89dee8a2c25..ee928e4e381f1968d84b0145dbd06817ddc5772c 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,8 +15,8 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-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;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class NaturalLanguageSection extends AbstractCdmDetailSection<TaxonDescription> {
-       
+
        /**
         * <p>Constructor for NaturalLanguageSection.</p>
         *
@@ -42,22 +42,21 @@ public class NaturalLanguageSection extends AbstractCdmDetailSection<TaxonDescri
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.NATURAL_LANGUAGE;
+       public String getHeading() {
+               return "Natural Language Description";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return "Natural Language Description";
+       protected AbstractCdmDetailElement<TaxonDescription> createCdmDetailElement(AbstractCdmDetailSection<TaxonDescription> parentElement, int style) {
+           return formFactory.createNaturalLanguageDetailElement(parentElement);
        }
 }
index 84aeb25ec64a58e5ca68f89d546a73679d2cc70b..456fc997f3569aca86f576cd8a45d468261a8125 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.Feature;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class FeatureDistributionDetailSection extends AbstractCdmDetailSection<Feature> {
-       
+
        /**
         * <p>Constructor for FeatureDistributionDetailSection.</p>
         *
@@ -42,22 +42,22 @@ public class FeatureDistributionDetailSection extends AbstractCdmDetailSection<F
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.FEATURE_DISTRIBUTION;
+       public String getHeading() {
+               return "Distribution Map";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return "Distribution Map";
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<Feature> parentElement, int style) {
+           //FIXME generic
+           return formFactory.createFeatureDistributionDetailElement(parentElement);
        }
 }
index 47d911def13d98047f3a14b1ee733ead823e036a..3fd5b3887f93fcbc7639bc8b83045f302dca68be 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.ui.section.grantedAuthority;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
@@ -34,7 +31,7 @@ public class GrantedAuthorityDetailWizardPage extends AbstractCdmEntityWizardPag
        @Override
        public AbstractCdmDetailElement<GrantedAuthorityImpl> createElement(
                        ICdmFormElement rootElement) {
-               GrantedAuthorityDetailElement authorityElement = (GrantedAuthorityDetailElement) formFactory.createCdmDetailElement(DetailType.GRANTEDAUTHORITY, rootElement, SWT.NULL);
+               GrantedAuthorityDetailElement authorityElement = formFactory.createGrantedAuthorityDetailElement(rootElement);
                authorityElement.setEntity(getEntity());
                return authorityElement;
        }
index 9d66d8208c1c5cdb636b6c6475aa8d41a041b7c8..e5543bd3496daa996eeeceb3fc2b680b05f946a7 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.Group;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -40,19 +40,19 @@ public class GroupDetailSection extends AbstractCdmDetailSection<Group> {
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.GROUP;
+       public String getHeading() {
+               return "Group " + (getEntity() != null ? getEntity().getName() : "");
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Group " + (getEntity() != null ? getEntity().getName() : "");
+       protected AbstractCdmDetailElement<Group> createCdmDetailElement(AbstractCdmDetailSection<Group> parentElement, int style) {
+           return formFactory.createGroupDetailElement(parentElement);
        }
 
 }
index 35a6292a342e153ffc519f5646f8b1afcf95b20a..15c4f491029dc95713ac20c8d6ae665e902c6239 100644 (file)
@@ -1,23 +1,20 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.group;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
@@ -44,7 +41,7 @@ public class GroupDetailWizardPage  extends AbstractCdmEntityWizardPage<Group>{
        @Override
        public AbstractCdmDetailElement<Group> createElement(
                        ICdmFormElement rootElement) {
-               GroupDetailElement groupElement = (GroupDetailElement) formFactory.createCdmDetailElement(DetailType.GROUP, rootElement, SWT.NULL);
+               GroupDetailElement groupElement = formFactory.createGroupDetailElement(rootElement);
                return groupElement;
        }
 
index 390de78b72ce361b96f01beec1150c73eab65777..68a5db7d82cd6091816507fb0948683c2274c639 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
@@ -9,7 +9,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -25,19 +25,19 @@ public class PolytomousKeyDetailSection extends AbstractCdmDetailSection<Polytom
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.POLYTOMOUS_KEY;
+       public String getHeading() {
+               return "Polytomous Key";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Polytomous Key";
+       protected AbstractCdmDetailElement<PolytomousKey> createCdmDetailElement(AbstractCdmDetailSection<PolytomousKey> parentElement, int style) {
+           return formFactory.createPolytomousKeyDetailElement(parentElement);
        }
 
 }
index fdfa6470970409575b0751e4f4ebc0155b50aa73..65c4d636c64fa269a0719d991b603160edb3ea03 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
@@ -9,7 +9,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -23,21 +23,21 @@ public class PolytomousKeyNodeDetailSection extends AbstractCdmDetailSection<Pol
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.POLYTOMOUS_KEY_NODE;
+       public String getHeading() {
+               return "Polytomous Key Node";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Polytomous Key Node";
+       protected AbstractCdmDetailElement<PolytomousKeyNode> createCdmDetailElement(AbstractCdmDetailSection<PolytomousKeyNode> parentElement, int style) {
+           return formFactory.createPolytomousKeyNodeDetailElement(parentElement);
        }
 
 }
index 7fba074cd955d3b01b3917ce0afeeb8a6d05d765..66c071ced89a6194752dcd6949672531c606bbdd 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -46,7 +46,7 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
                        ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /**
         * {@inheritDoc}
         *
@@ -61,7 +61,8 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
@@ -76,12 +77,6 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
        public String getHeading() {
                return "Authorship";
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.AUTHORSHIP;
-       }
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
@@ -90,5 +85,13 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           return formFactory.createAuthorshipDetailElement(parentElement, style);
+       }
+
 }
index 77fb8fe00c420f43c7e1bf5b6788faa641d42847..ae1812feb33c3d6804ac019fd5d4c4541a5ec7ba 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -46,7 +46,7 @@ public class HybridDetailSection extends AbstractCdmDetailSection<TaxonNameBase>
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonBaseDetailSection#setTaxonBase(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
@@ -65,14 +65,6 @@ public class HybridDetailSection extends AbstractCdmDetailSection<TaxonNameBase>
                return taxonBase;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.HYBRID;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
@@ -88,5 +80,14 @@ public class HybridDetailSection extends AbstractCdmDetailSection<TaxonNameBase>
        protected void setSectionTitle() {
                setText(getHeading());
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<TaxonNameBase> parentElement, int style) {
+        //FIXME generic
+           return formFactory.createHybridDetailElement(parentElement);
+       }
+
 }
index 1b18a4562e5071ced863e21f0a2cde729e28204f..32315ed8d3fbf27442281994cfd28579413f141a 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -48,7 +48,8 @@ public class NameDetailSection extends AbstractCdmDetailSection<NonViralName> im
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
@@ -60,19 +61,13 @@ public class NameDetailSection extends AbstractCdmDetailSection<NonViralName> im
                return "Scientific Name";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.SCIENTIFICNAME;
-       }
-
        /** {@inheritDoc} */
        @Override
        protected void setSectionTitle() {
                if(!isDisposed()){
                        String title = "";
                        if(getEntity() != null && (getEntity() instanceof NonViralName)){
-                                title = ": " + ((NonViralName) getEntity()).getNameCache();
+                                title = ": " + getEntity().getNameCache();
                        }
                        this.setText(getHeading() + title);
                }
@@ -85,5 +80,12 @@ public class NameDetailSection extends AbstractCdmDetailSection<NonViralName> im
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           return formFactory.createNameDetailElement(parentElement, style);
+       }
 }
index 55662b2d56b7870597dc735d34b92724ea0d3ebd..d4e17a472caef42b9a0a579f8b68cf870202d2fc 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -12,14 +12,13 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import java.util.Arrays;
 
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 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.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
@@ -28,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement
  * <p>
  * NonViralNameDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created May 20, 2010
  * @version 1.0
@@ -45,7 +44,7 @@ public class NonViralNameDetailElement extends
         * <p>
         * Constructor for NonViralNameDetailElement.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -60,7 +59,7 @@ public class NonViralNameDetailElement extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
         * (eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement,
@@ -68,39 +67,27 @@ public class NonViralNameDetailElement extends
         */
        /** {@inheritDoc} */
        @Override
-       protected void createControls(ICdmFormElement formElement,
-                       final NonViralName entity, int style) {
-
-               toggleable_cache = formFactory.createToggleableTextField(formElement,
-                               "Cache", entity.getTitleCache(), entity.isProtectedTitleCache()
-                                               || entity.isProtectedFullTitleCache(), style);
-
-               combo_nomenclaturalCode = formFactory
-                               .createEnumComboElement(NomenclaturalCode.class,
-                                               formElement, style);
-               combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-
-               section_name = (NameDetailSection) formFactory.createCdmDetailSection(
-                               DetailType.SCIENTIFICNAME, getConversationHolder(),
-                               formElement, null, Section.TWISTIE | Section.EXPANDED);
-               section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_name);
-               addElement(section_name);
-               section_author = (AuthorshipDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.AUTHORSHIP,
-                                               getConversationHolder(), formElement, null,
-                                               Section.TWISTIE | Section.EXPANDED);
-               section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_author);
-               addElement(section_author);
-               
-               section_hybrid = (HybridDetailSection) formFactory.createCdmDetailSection(DetailType.HYBRID, 
-                                               getConversationHolder(), formElement, null, 
-                                               Section.TWISTIE);
-               section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_hybrid);
-               addElement(section_hybrid);
-       }
+    protected void createControls(ICdmFormElement formElement, final NonViralName entity, int style) {
+
+        toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
+
+        combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+        combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+
+        section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        addControl(section_name);
+        addElement(section_name);
+        section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        addControl(section_author);
+        addElement(section_author);
+
+        section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+        section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        addControl(section_hybrid);
+        addElement(section_hybrid);
+    }
 
        /** {@inheritDoc} */
        @Override
@@ -144,7 +131,7 @@ public class NonViralNameDetailElement extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
         * .lang.Object)
@@ -159,8 +146,9 @@ public class NonViralNameDetailElement extends
                        // initiating the free text name editor
                        getEntity().setProtectedFullTitleCache(false);
                } else if (eventSource == section_name || eventSource == section_author) {
-                       if (getParentElement() instanceof AbstractCdmDetailSection)
-                               ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+                       if (getParentElement() instanceof AbstractCdmDetailSection) {
+                ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+            }
                        if (!toggleable_cache.getState()) {
                                toggleable_cache.setText(getEntity().getTitleCache());
                        }
index d76f59a91f74368ce3dd6eb9dc3d36ce0dafbefb..654a025e439f8bffc0632401d0ddc8d70134bbac 100644 (file)
@@ -23,9 +23,9 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 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.ITaxonBaseDetailSection;
 
@@ -99,15 +99,6 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                return nonViralName.getTaxonBases().size() != 1;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.NONVIRALNAME;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
@@ -135,4 +126,12 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           return formFactory.createNonViralNameDetailElement(parentElement);
+       }
 }
index 4603f031d019265fda97ab9977e2f023980f12dc..de04f7c59b8da4de5f7428fa946fd819aae0db7d 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.name;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -43,15 +40,15 @@ public class NonViralNameWizardPage extends AbstractCdmEntityWizardPage<NonViral
                super(formFactory, conversation, entity);
                setTitle("Name");
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<NonViralName> createElement(ICdmFormElement rootElement) {
-               nameElement = (NonViralNameDetailElement) formFactory.createCdmDetailElement(DetailType.NONVIRALNAME, rootElement, SWT.NULL);
+               nameElement = formFactory.createNonViralNameDetailElement(rootElement);
                nameElement.setEntity(entity);
                return nameElement;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void dispose() {
index 9c9574b310ccd2c7a535b823e71bd0dda3749075..ba24188ba30f70087150c3f54ca1110a784a0d8a 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -49,14 +46,14 @@ public class CollectionWizardPage extends AbstractCdmEntityWizardPage<Collection
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<Collection> createElement(ICdmFormElement rootElement) {
-               CollectionDetailElement collectionDetailElement = (CollectionDetailElement) formFactory.createCdmDetailElement(DetailType.COLLECTION, rootElement, SWT.NULL);
+               CollectionDetailElement collectionDetailElement = formFactory.createCollectionDetailElement(rootElement);
                collectionDetailElement.setEntity(entity);
                return collectionDetailElement;
        }
index 00731806d889888e85b672afb3dc51af56b429fb..4f74484327f15fad999d8b6b534d1e27018aeb01 100644 (file)
@@ -15,7 +15,6 @@ 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.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;
@@ -44,15 +43,6 @@ public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<Deriv
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.DERIVED_UNIT;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
index 3524daad56d4285c53e69b2f18106bc92944e827..69b53eb65dd7dca0e769676ad0a0a94edf4415a4 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -46,14 +43,14 @@ public class DerivedUnitBaseWizardPage extends AbstractCdmEntityWizardPage<Deriv
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               DerivedUnitBaseDetailElement detailElement = (DerivedUnitBaseDetailElement) formFactory.createCdmDetailElement(DetailType.DERIVED_UNIT, rootElement, SWT.NULL);
-               detailElement.setEntity(getEntity());           
+               DerivedUnitBaseDetailElement detailElement = formFactory.createDerivedUnitBaseDetailElement(rootElement);
+               detailElement.setEntity(getEntity());
                return detailElement;
        }
 
index 3997d2af3390a13e7b3ebd7720d58eedd9386f8e..edd068f7ff91d83f365e3d54c60da50ae5063128 100644 (file)
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeConfigurator;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 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.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
@@ -35,7 +34,7 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
 
        private DerivedUnitFacade facade;
 
-       private DerivedUnitFacadeConfigurator configurator;
+       private final DerivedUnitFacadeConfigurator configurator;
 
        private GeneralDetailSection section_general;
        private GatheringEventDetailSection section_gatheringEvent;
@@ -69,7 +68,7 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
                        section_fieldObservation.setEntity(facade);
 
                } catch (DerivedUnitFacadeNotSupportedException e) {
-                       StoreUtil.errorDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
+                       AbstractUtility.errorDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
                }
        }
 
@@ -119,22 +118,22 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
        protected void createControls(ICdmFormElement formElement,
                        DerivedUnitBase entity, int style) {
 
-               section_general = (GeneralDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT_GENERAL, getConversationHolder(), formElement, null, Section.TWISTIE | Section.EXPANDED);
+               section_general = formFactory.createGeneralDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
                section_general.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_general);
                addElement(section_general);
 
-               section_gatheringEvent = (GatheringEventDetailSection) formFactory.createCdmDetailSection(DetailType.GATHERING_EVENT, getConversationHolder(), formElement, null, Section.TWISTIE);
+               section_gatheringEvent = formFactory.createGatheringEventDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
                section_gatheringEvent.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_gatheringEvent);
                addElement(section_gatheringEvent);
 
-               section_fieldObservation = (FieldObservationDetailSection) formFactory.createCdmDetailSection(DetailType.FIELD_OBSERVATION, getConversationHolder(), formElement, null, Section.TWISTIE);
+               section_fieldObservation = formFactory.createFieldObservationDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
                section_fieldObservation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_fieldObservation);
                addElement(section_fieldObservation);
 
-               section_derivedUnitBase = (DerivedUnitBaseDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT, getConversationHolder(), formElement, null, Section.TWISTIE);
+               section_derivedUnitBase = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
                section_derivedUnitBase.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_derivedUnitBase);
                addElement(section_derivedUnitBase);
index c099a4d204c77f4ad3828fcba8924c3a32f14bf3..5c410bf52a3e96cd75da6192d8550206bd48b7ae 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,8 +15,8 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-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;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class DerivedUnitFacadeDetailSection extends AbstractCdmDetailSection<DerivedUnitBase> {
-       
+
        /**
         * <p>Constructor for DerivedUnitFacadeDetailSection.</p>
         *
@@ -42,16 +42,18 @@ public class DerivedUnitFacadeDetailSection extends AbstractCdmDetailSection<Der
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.DERIVED_UNIT_FACADE;
-       }
 
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Unit";
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<DerivedUnitBase> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitBase> parentElement, int style) {
+           return formFactory.createDerivedUnitFacadeDetailElement(parentElement);
+       }
 }
index 036b660af24e3f2bb28111b132939095a21bc9ef..c2ae96f52ef0504d08be5275e2d622cf8f1b4a37 100644 (file)
@@ -15,7 +15,6 @@ 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.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;
@@ -40,14 +39,6 @@ public class DeterminationDetailSection extends AbstractCdmDetailSection<Derived
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
-        */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.DETERMINATION;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
         */
index 4abccf799060d904d944030e095783e0125facea..cb538c9fca492b52522f3b97ee1d89f76989c0b9 100644 (file)
@@ -15,7 +15,6 @@ 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.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;
@@ -44,12 +43,6 @@ public class FieldObservationDetailSection extends AbstractCdmDetailSection<Deri
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.FIELD_OBSERVATION;
-       }
-
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
index 803e713553d42d9276d42fc7322972761971c536..5228bdc9e64af2cad7ce087250fd7d314260572c 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -46,13 +43,13 @@ public class FieldObservationWizardPage extends AbstractCdmEntityWizardPage<Deri
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               FieldObservationDetailElement detailElement = (FieldObservationDetailElement) formFactory.createCdmDetailElement(DetailType.FIELD_OBSERVATION, rootElement, SWT.NONE);
+               FieldObservationDetailElement detailElement = formFactory.createFieldObservationDetailElement(rootElement);
                detailElement.setEntity(getEntity());
                return detailElement;
        }
index 41a04b2da253ea9d6e889167a66ff3a6daaf85df..44c86337ced629fe37cc2d9cfe7c1d8e52ea6510 100644 (file)
@@ -15,7 +15,6 @@ 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.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;
@@ -45,15 +44,6 @@ public class GatheringEventDetailSection extends AbstractCdmDetailSection<Derive
        }
 
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.GATHERING_EVENT;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
index 54dd833b140ad02f8779378c97c072328ae87a4a..bcfd178d4cc87a5e45145517faa9731f304a8efd 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -46,13 +43,13 @@ public class GatheringEventWizardPage extends AbstractCdmEntityWizardPage<Derive
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               GatheringEventDetailElement detailElement = (GatheringEventDetailElement) formFactory.createCdmDetailElement(DetailType.GATHERING_EVENT, rootElement, SWT.NULL);
+               GatheringEventDetailElement detailElement = formFactory.createGatheringEventDetailElement(rootElement);
                detailElement.setEntity(getEntity());
                return detailElement;
        }
index 39004c3a9a50f092b90c6318c453a673215c91f3..d2b3e7276464dd369cac52513469344626542902 100644 (file)
@@ -15,7 +15,6 @@ 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.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;
@@ -41,14 +40,6 @@ public class GeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFa
        }
 
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.DERIVED_UNIT_GENERAL;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
index 9b1224a0d87f83d08c126604d8914f9f175f0740..700686948103a2f3f4b89d7bbe508229df5038f1 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -45,13 +42,13 @@ public class GeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFa
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               GeneralDetailElement detailElement = (GeneralDetailElement) formFactory.createCdmDetailElement(DetailType.DERIVED_UNIT_GENERAL, rootElement, SWT.NULL);
+               GeneralDetailElement detailElement = formFactory.createGeneralDetailElement(rootElement);
                detailElement.setEntity(getEntity());
                checkComplete();
                return detailElement;
index d9a824f9cd0184a61da1d7d9b202a5a295f9be67..33cd1e7b9a856e4f6a77afc8ca726dea2c40ea40 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -48,12 +48,6 @@ public class NomenclaturalReferenceDetailSection extends
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.NOMENCLATURALREFERENCE;
-       }
 
        /** {@inheritDoc} */
        @Override
@@ -62,12 +56,13 @@ public class NomenclaturalReferenceDetailSection extends
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                TaxonNameBase name = (TaxonNameBase) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected void setSectionTitle() {
@@ -76,7 +71,7 @@ public class NomenclaturalReferenceDetailSection extends
                        INomenclaturalReference reference = getEntity().getNomenclaturalReference();
                        String nomenclaturalCitation = reference.getNomenclaturalCitation(getEntity().getNomenclaturalMicroReference());
                        title = ": " + nomenclaturalCitation;
-               }       
+               }
                this.setText(getHeading() + title);
        }
 
@@ -87,4 +82,12 @@ public class NomenclaturalReferenceDetailSection extends
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<TaxonNameBase> createCdmDetailElement(AbstractCdmDetailSection<TaxonNameBase> parentElement, int style) {
+           return formFactory.createNomenclaturalReferenceDetailElement(parentElement, style);
+       }
 }
index c04bad78fde5ae27840db5a81cc3359312b91d2f..ec35e1d9172b6857694f470130054ebc41fcae62 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -20,7 +20,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
  * @version 1.0
  */
 public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference> implements ITaxonBaseDetailSection{
-       
+
        private TaxonBase taxonBase;
 
        /**
@@ -54,12 +54,13 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
-               
+
                Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
-               
+
                setEntity(reference);
        }
 
@@ -73,12 +74,6 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
                return "Reference";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.REFERENCEBASE;
-       }       
-       
        /** {@inheritDoc} */
        @Override
        public void refresh() {
@@ -93,5 +88,13 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<Reference> createCdmDetailElement(AbstractCdmDetailSection<Reference> parentElement, int style) {
+           return formFactory.createReferenceDetailElement(parentElement, style);
+       }
+
 }
index bfd30b9e7e6b12295420953602204ef9495b83d5..a8bdfe4d0d4f5bdca50a1dc84334d12dbd361c83 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,6 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IExceptionHandler;
@@ -42,14 +41,15 @@ public class ReferenceWizardPage extends AbstractCdmEntityWizardPage<Reference>
                super(formFactory, conversation, entity);
                setTitle("Reference");
        }
-       
-       /* 
+
+       /*
         * (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        /** {@inheritDoc} */
-       public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){
-               ReferenceDetailElement referenceElement = (ReferenceDetailElement) formFactory.createCdmDetailElement(DetailType.REFERENCEBASE, rootElement, SWT.NULL);
+       @Override
+    public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){
+               ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL);
                referenceElement.addExceptionHandler(this);
                referenceElement.setEntity(entity);
                return referenceElement;
index af0d316cf39b659ef73810b7035e3d73ef52d129..bf989c41c3a3bbe6a703b7ddfea5845ad565a913 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,7 +21,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -39,7 +39,7 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
        /** Constant <code>HEADING_PROBLEM="The name has problems."</code> */
        public static final String HEADING_PROBLEM = "The name has problems.";
        private TaxonBase taxonBase;
-       
+
        /**
         * <p>Constructor for ParsingMessagesSection.</p>
         *
@@ -53,15 +53,16 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
                        ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected void createControls(AbstractCdmDetailSection formElement, int style) {
                // we do it differently here
        }
-       
+
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                setEntity((NonViralName) HibernateProxyHelper.deproxy(entity.getName()));
                destroyParsingProblemComposites();
@@ -69,7 +70,7 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
                        displayParsingProblems();
                }
        }
-       
+
        private void destroyParsingProblemComposites() {
                setText(HEADING_SUCCESS);
                for(Control control : getLayoutComposite().getChildren()){
@@ -92,12 +93,6 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
                return HEADING_SUCCESS;
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.PARSINGMESSAGE;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
@@ -105,4 +100,13 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           //no detail element
+           return null;
+       }
 }
index 8ba2e34493164cfece42ac545f70b434259a599c..e0a5d92eb6cfed6cc58c454d04f405c70ccd7cc7 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,7 +17,7 @@ import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -50,9 +50,10 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
-               TaxonBase taxonBase = (TaxonBase) HibernateProxyHelper.deproxy(entity); 
+               TaxonBase taxonBase = (TaxonBase) HibernateProxyHelper.deproxy(entity);
                setEntity(taxonBase);
        }
 
@@ -62,12 +63,6 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
                return getEntity() != null ? getEntity().getClass().getSimpleName() : "TaxonBase";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.TAXONBASE;
-       }
-       
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
@@ -76,4 +71,12 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
                return taxonBase;
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<TaxonBase> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase> parentElement, int style) {
+           return formFactory.createTaxonBaseDetailElement(parentElement, style);
+       }
+
 }
index 262a9eb5728b81713c15c6f6c6bc06371042bf5c..c787ad00d6c7ab31bd01226e64194ffe0c05381e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -32,13 +32,16 @@ public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<Tax
        }
 
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.TAXON_RELATIONSHIP;
+       public String getHeading() {
+               return "Taxon Relationship";
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       public String getHeading() {
-               return "Taxon Relationship";
+       protected AbstractCdmDetailElement<TaxonRelationship> createCdmDetailElement(AbstractCdmDetailSection<TaxonRelationship> parentElement, int style) {
+           return formFactory.createTaxonRelationshipDetailElement(parentElement);
        }
 
 }
index e1010d885b8509bfd72987cba837cb213eaa92ef..a80b492c070a74a1f27225c8fbc7e20506714615 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.user;
 
@@ -12,7 +12,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.User;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -37,19 +37,18 @@ public class UserDetailSection extends AbstractCdmDetailSection<User> {
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.USER;
+       public String getHeading() {
+               return "User " + (getEntity() != null ? getEntity().getUsername() : "");
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "User " + (getEntity() != null ? getEntity().getUsername() : "");
+       protected AbstractCdmDetailElement<User> createCdmDetailElement(AbstractCdmDetailSection<User> parentElement, int style) {
+           return formFactory.createUserDetailElement(parentElement);
        }
-
 }
index 3c82fbe956124e1db7840248c3ad18f0e3f71a6a..972b92dc637a70813541891d4cbd349d35f86717 100644 (file)
@@ -1,15 +1,12 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.user;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -30,11 +27,11 @@ public class UserDetailWizardPage extends AbstractCdmEntityWizardPage<User> {
         */
        @Override
        public AbstractCdmDetailElement<User> createElement(ICdmFormElement rootElement) {
-               UserDetailElement userElement = (UserDetailElement) formFactory.createCdmDetailElement(DetailType.USER, rootElement, SWT.NULL);
+               UserDetailElement userElement = formFactory.createUserDetailElement(rootElement);
                userElement.setEntity(getEntity());
                return userElement;
        }
-       
+
        @Override
        protected void checkComplete() {
                boolean hasUsername = getEntity().getUsername() != null;
index 953928966b73d2cbe145f9eeb0b6bf0fa0d0e594..01b8ce6e5aa6cae218f36dcf69efd83a438d3327 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2011 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -14,20 +14,20 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
  * UseRecordDetailSection Class\r
- * @author a.theys     \r
+ * @author a.theys\r
  * @created mar 13, 2012\r
  * @version 1.0\r
  */\r
 public class UseRecordDetailSection extends AbstractCdmDetailSection<DescriptionElementBase> {\r
-       \r
+\r
        /**Constructor for class UseRecordDetailSection\r
-        * \r
+        *\r
         * @param cdmFormFactory\r
         * @param conversation\r
         * @param parentElement\r
@@ -38,23 +38,26 @@ public class UseRecordDetailSection extends AbstractCdmDetailSection<Description
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {\r
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);\r
        }\r
-       \r
-       /** {@inheritDoc} */\r
-       @Override\r
-       protected DetailType getDetailType() {\r
-               return DetailType.USE_RECORD;\r
-       }\r
-       \r
+\r
        /** {@inheritDoc} */\r
        @Override\r
        public String getHeading() {\r
                return "Use Record";\r
        }\r
-       \r
+\r
        /** {@inheritDoc} */\r
        @Override\r
        protected void setSectionTitle() {\r
                this.setText(getHeading() + ": " + getEntity().getFeature().getLabel(CdmStore.getDefaultLanguage()));\r
                setTextClient(createToolbar());\r
        }\r
+\r
+       /* (non-Javadoc)\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
+        */\r
+       @Override\r
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<DescriptionElementBase> parentElement, int style) {\r
+           return formFactory.createUseRecordDetailElement(parentElement);\r
+       }\r
+\r
 }\r
index 14c9f6267a55c78ebdfa7c68bd52472c770f0cbc..b7e482e6021c2c55b625433460e36ff9b0a6e329 100644 (file)
 package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
 \r
 import org.eclipse.jface.viewers.ISelectionProvider;\r
-import org.eclipse.ui.forms.widgets.TableWrapLayout;\r
 \r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -41,29 +40,28 @@ public class DefinedTermDetailSection<T extends DefinedTermBase> extends Abstrac
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
-       protected DetailType getDetailType() {\r
-               return null;\r
+       public String getHeading() {\r
+               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
-    @Override\r
-    protected void createControlsByType(AbstractCdmDetailSection<T> abstractCdmDetailSection, Class<T> clazz, int style) {\r
-        TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();\r
-        layout.topMargin = 10;\r
-        layout.numColumns = 2;\r
-\r
-        getLayoutComposite().setLayout(layout);\r
-        detailElement = formFactory.createDefinedTermDetailElement(clazz, abstractCdmDetailSection, style);\r
-    }\r
+       //FIXME clean up create element methods\r
+       /* (non-Javadoc)\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElementByType(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, java.lang.Class, int)\r
+        */\r
+       @Override\r
+       protected AbstractCdmDetailElement createCdmDetailElementByType(AbstractCdmDetailSection<T> parentElement, Class<T> entityClass, int style) {\r
+           return formFactory.createDefinedTermDetailElement(entityClass, parentElement, style);\r
+       }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
         */\r
        @Override\r
-       public String getHeading() {\r
-               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
+       protected AbstractCdmDetailElement<T> createCdmDetailElement(AbstractCdmDetailSection<T> parentElement, int style) {\r
+           return null;\r
        }\r
 \r
 }\r
index c8242850facfffeac967494cbf1daec615d4d100..86082a69091da8672f363862ef07f576943f3f48 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.location.NamedArea;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -40,21 +40,20 @@ public class NamedAreaDetailSection extends AbstractCdmDetailSection<NamedArea>
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
-       protected DetailType getDetailType() {\r
-               \r
-               return DetailType.NAMED_AREA;\r
+       public String getHeading() {\r
+\r
+               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
         */\r
        @Override\r
-       public String getHeading() {\r
-               \r
-               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
+       protected AbstractCdmDetailElement<NamedArea> createCdmDetailElement(AbstractCdmDetailSection<NamedArea> parentElement, int style) {\r
+           return formFactory.createNamedAreaDetailElement(parentElement);\r
        }\r
 \r
 }\r
index cf6394ef779f5d0d3f4edbd445b206459695ae0d..69daf2ba76b39f7046cad95a9767df3b09f11722 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -37,20 +37,19 @@ public class NamedAreaLevelDetailSection extends AbstractCdmDetailSection<NamedA
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
-       protected DetailType getDetailType() {\r
-               \r
-               return DetailType.NAMED_AREA_LEVEL;\r
+       public String getHeading() {\r
+               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
         */\r
        @Override\r
-       public String getHeading() {\r
-               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
+       protected AbstractCdmDetailElement<NamedAreaLevel> createCdmDetailElement(AbstractCdmDetailSection<NamedAreaLevel> parentElement, int style) {\r
+           return formFactory.createNamedAreaLevelElement(parentElement);\r
        }\r
 \r
 }\r
index 18f10bf670b19f925a2ab49267a8ac11ba852130..767ffb8fef3d93ff17677bd9dee7224373944fae 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -40,24 +40,15 @@ public class TermVocabularyDetailSection extends
                // TODO Auto-generated constructor stub\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
-        */\r
-       @Override\r
-       protected DetailType getDetailType() {\r
-               \r
-               return DetailType.TERM_VOCABULARY;\r
-       }\r
-\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
        public String getHeading() {\r
-               \r
+\r
                return "Vocabulary: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
-       \r
+\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#setSectionTitle()\r
         */\r
@@ -65,4 +56,12 @@ public class TermVocabularyDetailSection extends
        protected void setSectionTitle() {\r
                setText(getHeading());\r
        }\r
+\r
+       /* (non-Javadoc)\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
+        */\r
+       @Override\r
+       protected AbstractCdmDetailElement<TermVocabulary> createCdmDetailElement(AbstractCdmDetailSection<TermVocabulary> parentElement, int style) {\r
+           return formFactory.createTermVocabularyDetailElement(parentElement);\r
+       }\r
 }\r
index bc5e6b17083355736c7a25496aaa83c571ebdf2e..4fe9b9f42a321474a6af11e2560d2f83d5eb0661 100644 (file)
@@ -48,7 +48,6 @@ import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
@@ -230,7 +229,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
             createMediaElementSection(rootElement);
 
         } else if (input instanceof DerivedUnitFacade) {
-            createFOSection(rootElement);
+            createDerivedUnitBaseElementSection(rootElement);
 
         } else if (input instanceof FeatureNodeContainer) {
             createFeatureDistributionSection(rootElement);
@@ -262,15 +261,9 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createGroupSection(RootElement parent) {
         destroySections();
 
-        GroupDetailSection groupDetailSection = (GroupDetailSection) formFactory.createCdmDetailSection(
-                DetailType.GROUP, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
-        MemberDetailSection memberDetailSection = (MemberDetailSection) formFactory.createEntityDetailSection(
-                EntityDetailType.MEMBER, getConversationHolder(), parent, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
-        GrantedAuthorityDetailSection grantedAuthorityDetailSection = (GrantedAuthorityDetailSection) formFactory
-                .createEntityDetailSection(EntityDetailType.GRANTED_AUTHORITY, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
+        MemberDetailSection memberDetailSection = (MemberDetailSection) formFactory.createEntityDetailSection(EntityDetailType.MEMBER, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        GrantedAuthorityDetailSection grantedAuthorityDetailSection = (GrantedAuthorityDetailSection) formFactory.createEntityDetailSection(EntityDetailType.GRANTED_AUTHORITY, getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(groupDetailSection);
         addPart(memberDetailSection);
@@ -311,47 +304,36 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createTaxonSections(RootElement parent) {
         destroySections();
 
-        TaxonBaseDetailSection taxonBaseDetailSection = (TaxonBaseDetailSection) formFactory.createCdmDetailSection(
-                DetailType.TAXONBASE, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+        TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory.createCdmDetailSection(
-                DetailType.NONVIRALNAME, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
                         | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection) formFactory
-                .createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE);
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory
-                .createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent,ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(
-                EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(
-                EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory
-                .createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ParsingMessagesSection parsingMessagesSection = (ParsingMessagesSection) formFactory.createCdmDetailSection(
-                DetailType.PARSINGMESSAGE, getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
+        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
 
         addPart(taxonBaseDetailSection);
         addPart(nonViralNameSection);
@@ -370,37 +352,27 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createNameSections(RootElement parent) {
         destroySections();
-        NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory.createCdmDetailSection(
-                DetailType.NONVIRALNAME, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection) formFactory
-                .createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE);
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory
-                .createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(
-                EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(
-                EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory
-                .createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -420,9 +392,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createReferenceSections(RootElement parent) {
         destroySections();
 
-        ReferenceDetailSection referenceDetailSection = (ReferenceDetailSection) formFactory.createCdmDetailSection(
-                DetailType.REFERENCEBASE, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
+        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(referenceDetailSection);
     }
@@ -434,9 +404,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createTeamOrPersonBaseDetailSection(RootElement parent) {
         destroySections();
-        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = (TeamOrPersonBaseDetailSection) formFactory
-                .createCdmDetailSection(DetailType.TEAMORPERSONBASE, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(teamOrPersonBaseDetailSection);
     }
@@ -448,8 +416,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createTeamDetailSection(RootElement parent) {
         destroySections();
-        TeamDetailSection teamDetailSection = (TeamDetailSection) formFactory.createCdmDetailSection(DetailType.TEAM,
-                getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(teamDetailSection);
     }
@@ -461,9 +428,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createPersonDetailSection(RootElement parent) {
         destroySections();
-        PersonDetailSection personDetailSection = (PersonDetailSection) formFactory.createCdmDetailSection(
-                DetailType.PERSON, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
+        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         addPart(personDetailSection);
     }
 
@@ -475,21 +440,15 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createDescriptionElementSection(RootElement parent) {
         destroySections();
 
-        DescriptionElementDetailSection descriptionElementDetailSection = (DescriptionElementDetailSection) formFactory
-                .createCdmDetailSection(DetailType.DESCRIPTIONELEMENT, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionElementSourceSection descriptionElementSourceSection = (DescriptionElementSourceSection) formFactory
-                .createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTSOURCE, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        DescriptionElementSourceSection descriptionElementSourceSection = (DescriptionElementSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionElementMediaSection descriptionElementMediaSection = (DescriptionElementMediaSection) formFactory
-                .createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTMEDIA, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        DescriptionElementMediaSection descriptionElementMediaSection = (DescriptionElementMediaSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTMEDIA, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -505,32 +464,23 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createDescriptionSection(RootElement parent) {
         destroySections();
-        DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
-                .createCdmDetailSection(DetailType.DESCRIPTION, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NaturalLanguageSection naturalLanguageSection = (NaturalLanguageSection) formFactory.createCdmDetailSection(
-                DetailType.NATURAL_LANGUAGE, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
+        NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescribedSpecimenSection describedSpecimenSection = (DescribedSpecimenSection) formFactory
-                .createEntityDetailSection(EntityDetailType.DESCRIBED_SPECIMEN, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        DescribedSpecimenSection describedSpecimenSection = (DescribedSpecimenSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIBED_SPECIMEN, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
-                .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE);
+        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ScopeSection scopeSection = (ScopeSection) formFactory.createEntityDetailSection(EntityDetailType.SCOPE,
-                getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        ScopeSection scopeSection = (ScopeSection) formFactory.createEntityDetailSection(EntityDetailType.SCOPE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -548,15 +498,11 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createUseDescriptionSection(RootElement parent) {
         destroySections();
-        DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
-                .createCdmDetailSection(DetailType.DESCRIPTION, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
-                .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -570,9 +516,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createImageGallerySection(RootElement parent) {
         destroySections();
-        DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
-                .createCdmDetailSection(DetailType.DESCRIPTION, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(descriptionDetailSection);
     }
@@ -585,9 +529,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
     private void createMediaElementSection(RootElement parent) {
         destroySections();
-        MediaDetailsSection mediaDetailSection = (MediaDetailsSection) formFactory.createCdmDetailSection(
-                DetailType.MEDIA, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
+        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(mediaDetailSection);
     }
@@ -631,9 +573,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createFeatureDistributionSection(RootElement parent) {
         destroySections();
 
-        FeatureDistributionDetailSection featureDistributionSection = (FeatureDistributionDetailSection) formFactory
-                .createCdmDetailSection(DetailType.FEATURE_DISTRIBUTION, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(featureDistributionSection);
     }
@@ -646,21 +586,15 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createPolytomousKeyNodeSection(RootElement parent) {
         destroySections();
 
-        PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
-                .createCdmDetailSection(DetailType.POLYTOMOUS_KEY, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
+        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection) formFactory
-                .createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory.createEntityDetailSection(
-                EntityDetailType.TAXONOMIC_SCOPE, getConversationHolder(), parent, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.COMPACT);
+        TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory.createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
 
         addPart(polytomousKeyDetailSection);
         addPart(polytomousKeyNodeDetailSection);
@@ -676,9 +610,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createUseRecordSection(RootElement parent) {
         destroySections();
 
-        UseRecordDetailSection descriptionUseRecordSection = (UseRecordDetailSection) formFactory
-                .createCdmDetailSection(DetailType.USE_RECORD, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -694,12 +626,9 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createUserSection(RootElement parent) {
         destroySections();
 
-        UserDetailSection userDetailSection = (UserDetailSection) formFactory.createCdmDetailSection(DetailType.USER,
-                getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
-        GroupsByUserDetailSection groupByUserDetailSection = (GroupsByUserDetailSection) formFactory
-                .createEntityDetailSection(EntityDetailType.GROUPS_BY_USER, getConversationHolder(), parent,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        GroupsByUserDetailSection groupByUserDetailSection = (GroupsByUserDetailSection) formFactory.createEntityDetailSection(EntityDetailType.GROUPS_BY_USER, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(userDetailSection);
         addPart(groupByUserDetailSection);
@@ -713,13 +642,9 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createTaxonRelationshipSection(RootElement parent) {
         destroySections();
 
-        TaxonRelationshipDetailSection taxonRelationshipDetailSection = (TaxonRelationshipDetailSection) formFactory
-                .createCdmDetailSection(DetailType.TAXON_RELATIONSHIP, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
-        ReferencedEntityDetailSection referencedEntityBaseDetailSection = (ReferencedEntityDetailSection) formFactory
-                .createCdmDetailSection(DetailType.REFERENCED_ENTITY, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         addPart(taxonRelationshipDetailSection);
         addPart(referencedEntityBaseDetailSection);
     }
@@ -730,9 +655,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createTermVocabularySection(RootElement parent) {
         destroySections();
 
-        TermVocabularyDetailSection termVocabularyDetailSection = (TermVocabularyDetailSection) formFactory
-                .createCdmDetailSection(DetailType.TERM_VOCABULARY, getConversationHolder(), parent, this,
-                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         addPart(termVocabularyDetailSection);
     }
 
@@ -744,16 +667,14 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createDefinedTermSection(RootElement parent) {
         destroySections();
 
-        AbstractFormSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(
-                getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED);
+        AbstractFormSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         addPart(definedTermDetailSection);
     }
 
-    private void createFOSection(RootElement parent){
+    private void createFODetailsView(RootElement parent) {
         destroySections();
 
-        GeneralDetailSection generalDetailSection = formFactory.createFOSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        GeneralDetailSection generalDetailSection = formFactory.createFOSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -761,7 +682,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        FieldObservationDetailSection fieldObservationDetailSection =formFactory.createFODetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+        FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFODetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         addPart(generalDetailSection);
         addPart(gatheringEventDetailSection);