merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 22 Jul 2013 17:42:18 +0000 (17:42 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 22 Jul 2013 17:42:18 +0000 (17:42 +0000)
13 files changed:
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/agent/TeamDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/CategoricalDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/QuantitativeDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewer.java

index 822f70e6349aee41a6cf8693172c340cce3cb6a5..408e0acfea307c29a39237870be66c0eaa3639d0 100644 (file)
@@ -103,7 +103,6 @@ import eu.etaxonomy.taxeditor.ui.password.EditPasswordElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.EmptyElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionDetailSection;
@@ -1346,6 +1345,8 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+
+    //--------DetailSections---------
     public NameDetailSection createNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
         NameDetailSection section = new NameDetailSection(this, conversation, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
@@ -1574,6 +1575,7 @@ public class CdmFormFactory extends FormToolkit {
         adapt(section);
     }
 
+    //--------DetailElements------------
 
     public UseRecordDetailElement createUseRecordDetailElement(ICdmFormElement parentElement){
         UseRecordDetailElement element = new UseRecordDetailElement(this, parentElement);
@@ -1789,185 +1791,202 @@ public class CdmFormFactory extends FormToolkit {
         parentElement.addElement(element);
     }
 
-    /**
-     *
-     * Used to define which {@link AbstractEntityCollectionSection} should be
-     * created in
-     * {@link CdmFormFactory#createEntityDetailSection(EntityDetailType, ConversationHolder, ICdmFormElement, int)}
-     *
-     * @author n.hoffmann
-     * @created Mar 5, 2010
-     * @version 1.0
-     */
-    public static enum EntityDetailType {
-        TEAM, // never used
-        TEAMMEMBER,
-        ANNOTATION,
-        CREDIT,
-        DESCRIPTIONELEMENTSOURCE,
-        EXTENSION,
-        MARKER,
-        MEDIA,
-        DESCRIPTIONELEMENTMEDIA,
-        MEDIAREPRESENTATION,
-        MEDIAREPRESENTATIONPART,
-        MODIFIER,
-        NOMENCLATURALSTATUS,
-        NAME_RELATIONSHIP,
-        PROTOLOG,
-        RIGHTS,
-        SOURCE,
-        SCOPE,
-        DESCRIPTIONSOURCE,
-        TYPEDESIGNATION,
-        STATE_DATA,
-        STATISTICAL_MEASUREMENT_VALUE,
-        DESCRIBED_SPECIMEN,
-        COLLECTING_AREA, DETERMINATION_EVENT, // never used
-        SPECIMEN_COLLECTION,
-        IDENTIFIABLE_SOURCE_COLLECTION,
-        GEOGRAPHICAL_SCOPE, // never used
-        SCOPE_RESTRICTION,
-        MEMBER,
-        GRANTED_AUTHORITY,
-        GROUPS_BY_USER,
-        TAXONOMIC_SCOPE,
-        DETERMINATION_CURRENT,
-        DETERMINATION_HISTORY
+    //--------EntityCollectionSection----------
+    public TeamMemberSection createTeamMemberSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        TeamMemberSection section = new TeamMemberSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
     }
 
-    /**
-     * <p>
-     * createEntityDetailSection
-     * </p>
-     *
-     * @param entityDetailType
-     *            a
-     *            {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType}
-     *            object.
-     * @param style
-     *            a int.
-     * @param conversation
-     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-     *            object.
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-     *         object.
-     */
-    public AbstractFormSection createEntityDetailSection(EntityDetailType entityDetailType,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        AbstractFormSection section = null;
-
-//        System.out.println("EntityDetailSection: " + entityDetailType);
-        switch (entityDetailType) {
-        case TEAM:
-            // TODO this is not an AbstractEntityCollectionSection
-            section = new TeamDetailSection(this, conversation, parentElement, null, style);
-            break;
-        case TEAMMEMBER:
-            section = new TeamMemberSection(this, conversation, parentElement, style);
-            break;
-        case ANNOTATION:
-            section = new AnnotationSection(this, conversation, parentElement, style);
-            break;
-        case CREDIT:
-            section = new CreditSection(this, conversation, parentElement, style);
-            break;
-        case DESCRIPTIONELEMENTSOURCE:
-            section = new DescriptionElementSourceSection(this, conversation, parentElement, style);
-            break;
-        case EXTENSION:
-            section = new ExtensionSection(this, conversation, parentElement, style);
-            break;
-        case MARKER:
-            section = new MarkerSection(this, conversation, parentElement, style);
-            break;
-        case MEDIA:
-            section = new MediaSection(this, conversation, parentElement, style);
-            break;
-        case DESCRIPTIONELEMENTMEDIA:
-            section = new DescriptionElementMediaSection(this, conversation, parentElement, style);
-            break;
-        case MEDIAREPRESENTATION:
-            section = new MediaRepresentationSection(this, conversation, parentElement, style);
-            break;
-        case MEDIAREPRESENTATIONPART:
-            section = new MediaRepresentationPartSection(this, conversation, parentElement, style);
-            break;
-        case MODIFIER:
-            section = new ModifierSection(this, conversation, parentElement, style);
-            break;
-        case NOMENCLATURALSTATUS:
-            section = new NomenclaturalStatusSection(this, conversation, parentElement, style);
-            break;
-        case NAME_RELATIONSHIP:
-            section = new NameRelationshipDetailSection(this, conversation, parentElement, style);
-            break;
-        case PROTOLOG:
-            section = new ProtologueSection(this, conversation, parentElement, style);
-            break;
-        case RIGHTS:
-            section = new RightsSection(this, conversation, parentElement, style);
-            break;
-        case SOURCE:
-            section = new SourceSection(this, conversation, parentElement, style);
-            break;
-        case SCOPE:
-            section = new ScopeSection(this, conversation, parentElement, style);
-            break;
-        case DESCRIPTIONSOURCE:
-            section = new DescriptionSourceSection(this, conversation, parentElement, style);
-            break;
-        case TYPEDESIGNATION:
-            section = new TypeDesignationSection(this, conversation, parentElement, style);
-            break;
-        case STATE_DATA:
-            section = new StateDataSection(this, conversation, parentElement, style);
-            break;
-        case STATISTICAL_MEASUREMENT_VALUE:
-            section = new StatisticalMeasurementValueSection(this, conversation, parentElement, style);
-            break;
-        case DESCRIBED_SPECIMEN:
-            section = new DescribedSpecimenSection(this, conversation, parentElement, style);
-            break;
-        case COLLECTING_AREA:
-            section = new CollectingAreasDetailSection(this, conversation, parentElement, style);
-            break;
-        case DETERMINATION_CURRENT:
-            section = new CurrentDeterminationDetailSection(this, conversation, parentElement, style);
-            break;
-        case DETERMINATION_HISTORY:
-            section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style);
-            break;
-        case SPECIMEN_COLLECTION:
-            section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style);
-            break;
-        case IDENTIFIABLE_SOURCE_COLLECTION:
-            section = new SourceCollectionDetailSection(this, conversation, parentElement, style);
-            break;
-        case GEOGRAPHICAL_SCOPE:
-            section = new GeographicalScopeDetailSection(this, conversation, parentElement, style);
-            break;
-        case SCOPE_RESTRICTION:
-            section = new ScopeRestrictionSection(this, conversation, parentElement, style);
-            break;
-        case MEMBER:
-            section = new MemberDetailSection(this, conversation, parentElement, style);
-            break;
-        case GRANTED_AUTHORITY:
-            section = new GrantedAuthorityDetailSection(this, conversation, parentElement, style);
-            break;
-        case GROUPS_BY_USER:
-            section = new GroupsByUserDetailSection(this, conversation, parentElement, style);
-            break;
-        case TAXONOMIC_SCOPE:
-            section = new TaxonomicScopeSection(this, conversation, parentElement, style);
-            break;
-        }
-        parentElement.addElement(section);
-        adapt(section);
+    public AnnotationSection createAnnotationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        AnnotationSection section = new AnnotationSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public CreditSection createCreditSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        CreditSection section = new CreditSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ExtensionSection createExtensionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        ExtensionSection section = new ExtensionSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public MarkerSection createMarkerSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        MarkerSection section = new MarkerSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public MediaSection createMediaSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        MediaSection section = new MediaSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DescriptionElementMediaSection createDescriptionElementMediaSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        DescriptionElementMediaSection section = new DescriptionElementMediaSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public MediaRepresentationSection createMediaRepresentationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        MediaRepresentationSection section = new MediaRepresentationSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public MediaRepresentationPartSection createMediaRepresentationPartSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        MediaRepresentationPartSection section = new MediaRepresentationPartSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ModifierSection createModifierSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        ModifierSection section = new ModifierSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public NomenclaturalStatusSection createNomenclaturalStatusSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        NomenclaturalStatusSection section = new NomenclaturalStatusSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public NameRelationshipDetailSection createNameRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        NameRelationshipDetailSection section = new NameRelationshipDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ProtologueSection createProtologueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        ProtologueSection section = new ProtologueSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public RightsSection createRightsSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        RightsSection section = new RightsSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public SourceSection createSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        SourceSection section = new SourceSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ScopeSection createScopeSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        ScopeSection section = new ScopeSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DescriptionSourceSection createDescriptionSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        DescriptionSourceSection section = new DescriptionSourceSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TypeDesignationSection createTypeDesignationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        TypeDesignationSection section = new TypeDesignationSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public StateDataSection createStateDataSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        StateDataSection section = new StateDataSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public StatisticalMeasurementValueSection createStatisticalMeasurementValueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        StatisticalMeasurementValueSection section = new StatisticalMeasurementValueSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DescribedSpecimenSection createDescribedSpecimenSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        DescribedSpecimenSection section = new DescribedSpecimenSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public CollectingAreasDetailSection createCollectingAreasDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        CollectingAreasDetailSection section = new CollectingAreasDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public CurrentDeterminationDetailSection createCurrentDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        CurrentDeterminationDetailSection section = new CurrentDeterminationDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DeterminationHistoryDetailSection createDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        DeterminationHistoryDetailSection section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public SpecimenCollectionDetailSection createSpecimenCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        SpecimenCollectionDetailSection section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public SourceCollectionDetailSection createSourceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        SourceCollectionDetailSection section = new SourceCollectionDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GeographicalScopeDetailSection createGeographicalScopeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        GeographicalScopeDetailSection section = new GeographicalScopeDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ScopeRestrictionSection createScopeRestrictionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        ScopeRestrictionSection section = new ScopeRestrictionSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public MemberDetailSection createMemberDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        MemberDetailSection section = new MemberDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GrantedAuthorityDetailSection createGrantedAuthorityDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        GrantedAuthorityDetailSection section = new GrantedAuthorityDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GroupsByUserDetailSection createGroupsByUserDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        GroupsByUserDetailSection section = new GroupsByUserDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TaxonomicScopeSection createTaxonomicScopeSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        TaxonomicScopeSection section = new TaxonomicScopeSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
         return section;
     }
 
index 2462dd3c9b49f8787f330ac244735fe26aed7a7e..f338bc217ba0e62edc1a965b76c18327e838c651 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,7 +12,7 @@ package eu.etaxonomy.taxeditor.ui.section.agent;
 
 import java.util.Arrays;
 
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -20,14 +20,13 @@ import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 
 /**
  * <p>
  * TeamDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Apr 26, 2010
  * @version 1.0
@@ -42,7 +41,7 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
         * <p>
         * Constructor for TeamDetailElement.
         * </p>
-        * 
+        *
         * @param cdmFormFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -58,23 +57,14 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
        }
 
        /** {@inheritDoc} */
-       @Override
-       protected void createControls(ICdmFormElement formElement, Team entity,
-                       int style) {
-
-               toggleable_cache = formFactory.createToggleableTextField(formElement,
-                               "Title Cache", entity.getTitleCache(),
-                               entity.isProtectedTitleCache(), style);
-               toggleable_nomenclaturalTitleCache = formFactory
-                               .createToggleableTextField(formElement, "Abbrev. Title",
-                                               entity.getNomenclaturalTitle(),
-                                               entity.isProtectedNomenclaturalTitleCache(), style);
-               section_teamMembers = (TeamMemberSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.TEAMMEMBER,
-                                               getConversationHolder(), formElement, Section.EXPANDED);
-               section_teamMembers.setLayoutData(LayoutConstants
-                               .FILL_HORIZONTALLY(2, 1));
-       }
+    @Override
+    protected void createControls(ICdmFormElement formElement, Team entity, int style) {
+
+        toggleable_cache = formFactory.createToggleableTextField(formElement, "Title Cache", entity.getTitleCache(), entity.isProtectedTitleCache(), style);
+        toggleable_nomenclaturalTitleCache = formFactory.createToggleableTextField(formElement, "Abbrev. Title", entity.getNomenclaturalTitle(), entity.isProtectedNomenclaturalTitleCache(), style);
+        section_teamMembers = formFactory.createTeamMemberSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
+        section_teamMembers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+    }
 
        /** {@inheritDoc} */
        @Override
index f87cf6f88be30e63350b018b3d82bd64dc9f6054..94ceb4e99e6d31c936f49cd593a1dff2ca6edea0 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,7 @@
 package eu.etaxonomy.taxeditor.ui.section.description;
 
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.description.State;
@@ -23,7 +23,6 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 
 /**
@@ -34,7 +33,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
  * @version 1.0
  */
 public class StateDataElement extends AbstractEntityCollectionElement<StateData> {
-       
+
        private TermComboElement<State> combo_state;
        private ModifierSection section_modifiers;
        private TextWithLabelElement text_modifyingText;
@@ -53,22 +52,23 @@ public class StateDataElement extends AbstractEntityCollectionElement<StateData>
                        SelectionListener removeListener, int style) {
                super(formFactory, section, entity, removeListener, null, style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void setEntity(StateData entity) {
                this.entity = entity;
                combo_state.setSelection(entity.getState());
                section_modifiers.setEntity(entity);
-               if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null)
-                       text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
+               if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {
+            text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
+        }
        }
 
        /** {@inheritDoc} */
        @Override
        public void createControls(ICdmFormElement element, int style) {
                combo_state = formFactory.createTermComboElement(State.class, element, "State", null, style);
-               section_modifiers = (ModifierSection) formFactory.createEntityDetailSection(EntityDetailType.MODIFIER, getConversationHolder(), element, Section.TWISTIE);
+               section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE);
                section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                text_modifyingText = formFactory.createTextWithLabelElement(element, "Modifying Text", null, style);
        }
index bddaddeebed5cdd630c468b0c1abd213e752e3d1..ed7f08cd01fb7c6484906ed91d9e90e3128596f6 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,7 @@
 package eu.etaxonomy.taxeditor.ui.section.description;
 
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
@@ -21,7 +21,6 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 
 /**
@@ -33,7 +32,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
  */
 public class StatisticalMeasurementValueElement extends
                AbstractEntityCollectionElement<StatisticalMeasurementValue> {
-       
+
        private NumberWithLabelElement number_value;
        private TermComboElement<StatisticalMeasure> combo_type;
        private ModifierSection section_modifiers;
@@ -52,7 +51,7 @@ public class StatisticalMeasurementValueElement extends
                        SelectionListener removeListener, int style) {
                super(formFactory, section, entity, removeListener, null, style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void setEntity(StatisticalMeasurementValue entity) {
@@ -67,7 +66,7 @@ public class StatisticalMeasurementValueElement extends
        public void createControls(ICdmFormElement element, int style) {
                number_value = formFactory.createFloatTextWithLabelElement(element, "Value", 0, style);
                combo_type = formFactory.createTermComboElement(StatisticalMeasure.class, element, "Statistical Measure", null, style);
-               section_modifiers = (ModifierSection) formFactory.createEntityDetailSection(EntityDetailType.MODIFIER, getConversationHolder(), element, Section.TWISTIE);
+               section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE);
                section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
index 8a65b46b5042e3777968782f80094827a466784d..9f6ceb849e09d2c8ca3420c20dc0c11359300174 100644 (file)
@@ -1,15 +1,14 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.description.StateDataSection;
 
@@ -23,7 +22,7 @@ public class CategoricalDataDetailElement extends AbstractDetailedDescriptionDet
 
        private CheckboxElement checkbox_orderRelevant;
        private StateDataSection section_stateData;
-       
+
        /**
         * <p>Constructor for CategoricalDataDetailElement.</p>
         *
@@ -42,11 +41,11 @@ public class CategoricalDataDetailElement extends AbstractDetailedDescriptionDet
        protected void createControls(ICdmFormElement formElement,
                        CategoricalData entity, int style) {
                checkbox_orderRelevant = formFactory.createCheckbox(formElement, "Order Relevant", entity.getOrderRelevant(), style);
-               section_stateData = (StateDataSection) formFactory.createEntityDetailSection(EntityDetailType.STATE_DATA, getConversationHolder(), formElement, Section.TWISTIE | Section.EXPANDED);
+               section_stateData = formFactory.createStateDataSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
                section_stateData.setEntity(entity);
                section_stateData.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void setEntity(CategoricalData entity) {
index 11cbe80cf3cf9e3f311d1a0445e1c212269d9379..1315a206d7b99cf3fa174b1c06c6f16b392add71 100644 (file)
@@ -1,16 +1,15 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.description.MeasurementUnit;
 import eu.etaxonomy.cdm.model.description.QuantitativeData;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.description.StatisticalMeasurementValueSection;
 
@@ -25,7 +24,7 @@ public class QuantitativeDataDetailElement extends
 
        private TermComboElement<MeasurementUnit> combo_mesaurementUnit;
        private StatisticalMeasurementValueSection section_statisticalMeasurementValues;
-       
+
        /**
         * <p>Constructor for QuantitativeDataDetailElement.</p>
         *
@@ -44,11 +43,11 @@ public class QuantitativeDataDetailElement extends
        protected void createControls(ICdmFormElement formElement,
                        QuantitativeData entity, int style) {
                combo_mesaurementUnit = formFactory.createTermComboElement(MeasurementUnit.class, formElement, "Measurement Unit", entity.getUnit(), style);
-               section_statisticalMeasurementValues = (StatisticalMeasurementValueSection) formFactory.createEntityDetailSection(EntityDetailType.STATISTICAL_MEASUREMENT_VALUE, getConversationHolder(), formElement, Section.TWISTIE | Section.EXPANDED);
+               section_statisticalMeasurementValues = formFactory.createStatisticalMeasurementValueSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
                section_statisticalMeasurementValues.setEntity(entity);
                section_statisticalMeasurementValues.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
         */
index 1d49eae8412a5644c74b71922cce523e56594dfe..299bd27b45e895d7b76e029325358d71d8b6c07b 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.media;
 
@@ -13,7 +13,6 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -25,7 +24,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * <p>
  * MediaElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Nov 17, 2009
  * @version 1.0
@@ -41,7 +40,7 @@ public class MediaElement extends AbstractEntityCollectionElement<Media> {
         * <p>
         * Constructor for MediaElement.
         * </p>
-        * 
+        *
         * @param formElement
         *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
         *            object.
@@ -63,28 +62,19 @@ public class MediaElement extends AbstractEntityCollectionElement<Media> {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite
         * #createControls(org.eclipse.swt.widgets.Composite, int)
         */
        /** {@inheritDoc} */
-       @Override
-       public void createControls(ICdmFormElement element, int style) {
-               text_title = formFactory.createLanguageStringWithLabelElement(element,
-                               "Title", null, style);
-               selection_artist = formFactory
-                               .createSelectionElement(AgentBase.class,
-                                               getConversationHolder(), element, "Artist", null,
-                                               EntitySelectionElement.ALL, style);
-               text_description = formFactory.createLanguageStringWithLabelElement(
-                               element, "Description", null, 100, style);
-               section_mediaRepresentation = (MediaRepresentationSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.MEDIAREPRESENTATION,
-                                               getConversationHolder(), element, style);
-               section_mediaRepresentation.setLayoutData(LayoutConstants
-                               .FILL_HORIZONTALLY(2, 1));
+    @Override
+    public void createControls(ICdmFormElement element, int style) {
+        text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
+        selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style);
+        text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, style);
+        section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), element, style);
+        section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
        /** {@inheritDoc} */
@@ -110,7 +100,7 @@ public class MediaElement extends AbstractEntityCollectionElement<Media> {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
         * (java.lang.Object)
index 0bff02bf355ec1787fa0531b967604264c7f5022..ae2bbb7ba0a70c702692fe1d528b43f653788c66 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.
 */
@@ -24,7 +24,6 @@ import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
@@ -58,7 +57,7 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                        int style) {
                super(cdmFormFactory, section, element, removeListener, null, style);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
         */
@@ -67,7 +66,7 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
        public void createControls(ICdmFormElement element, int style) {
                text_mimeType = formFactory.createTextWithLabelElement(element, "Mime Type", null, style);
                text_suffix = formFactory.createTextWithLabelElement(element, "Suffix", null, style);
-               section_mediaRepresentationPart = (MediaRepresentationPartSection) formFactory.createEntityDetailSection(EntityDetailType.MEDIAREPRESENTATIONPART, getConversationHolder(), element, style);
+               section_mediaRepresentationPart = formFactory.createMediaRepresentationPartSection(getConversationHolder(), element, style);
                section_mediaRepresentationPart.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
@@ -79,7 +78,7 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                text_mimeType.setText(element.getMimeType());
                text_suffix.setText(element.getSuffix());
        }
-       
+
        /*
         * (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
@@ -94,15 +93,15 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                        getEntity().setSuffix(text_suffix.getText());
                }
                // FIXME HACK automatically set the mime type to the first mediaRepresentationPart's mimetype
-               else if(eventSource == section_mediaRepresentationPart){                        
+               else if(eventSource == section_mediaRepresentationPart){
                        firePropertyChangeEvent(this);
-                       
+
                        Collection<MediaRepresentationPart> imageFileElements = section_mediaRepresentationPart.getCollection(section_mediaRepresentationPart.getEntity());
-                       
+
                        if(! imageFileElements.iterator().hasNext()){
-                               return; 
+                               return;
                        }
-                       
+
                        MediaRepresentationPart mediaRepresentationPart = imageFileElements.iterator().next();
                        if(mediaRepresentationPart == null || !(mediaRepresentationPart instanceof ImageFile)){
                                return;
@@ -118,7 +117,7 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                                String mimeType = imageInfo.getMimeType();
                                text_mimeType.setText(mimeType);
                                getEntity().setMimeType(mimeType);
-                               text_suffix.setText(imageInfo.getSuffix());     
+                               text_suffix.setText(imageInfo.getSuffix());
                                getEntity().setSuffix(imageInfo.getSuffix());
                        } catch (IOException e) {
                                StoreUtil.error(getClass(), e);
index 1569bc08eb3467d5abbece97c0e85d93f9f332dd..2310b3d33266c8ba5d92af60178c2f82e899d8ca 100644 (file)
@@ -1,26 +1,25 @@
 // $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.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
@@ -31,7 +30,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * <p>
  * DerivedUnitBaseDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Jun 24, 2010
  * @version 1.0
@@ -59,7 +58,7 @@ public class DerivedUnitBaseDetailElement extends
         * <p>
         * Constructor for DerivedUnitBaseDetailElement.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -74,57 +73,39 @@ public class DerivedUnitBaseDetailElement extends
 
        /** {@inheritDoc} */
        @Override
-       protected void createControls(ICdmFormElement formElement,
-                       DerivedUnitFacade entity, int style) {
-               // Disable for now
-               // text_derivedUnitDefinitions =
-               // formFactory.createTextWithLabelElement(formElement,
-               // "Specimen Definition",
-               // facade.getDerivedUnitDefinition(CdmStore.getDefaultLanguage()),
-               // style);
-               text_barcode = formFactory.createTextWithLabelElement(formElement,
-                               "Barcode", entity.getBarcode(), style);
-               text_catalogNumber = formFactory
-                               .createTextWithLabelElement(formElement, "Catalog Number",
-                                               entity.getCatalogNumber(), style);
-
-               try {
-                       combo_preservationMethod = formFactory.createTermComboElement(PreservationMethod.class,
-                                                       formElement, "Preservation Method",
-                                                       entity.getPreservationMethod(), style);
-               } catch (MethodNotSupportedByDerivedUnitTypeException e) {
-                       // we ignore this
-                       StoreUtil.info(e.getMessage());
-               }
-               selection_storedUnder = formFactory
-                               .createSelectionElement(TaxonNameBase.class,
-                                               getConversationHolder(), formElement, "Stored Under",
-                                               entity.getStoredUnder(), EntitySelectionElement.ALL,
-                                               style);
-
-               try {
-                       text_exsicatum = formFactory.createTextWithLabelElement(
-                                       formElement, "Exsiccatum", entity.getExsiccatum(), style);
-               } catch (MethodNotSupportedByDerivedUnitTypeException e) {
-                       // we ignore this
-                       StoreUtil.info(e.getMessage());
-               }
-
-               section_duplicates = (SpecimenCollectionDetailSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.SPECIMEN_COLLECTION,
-                                               getConversationHolder(), formElement, Section.TWISTIE);
-               section_duplicates
-                               .setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               section_duplicates.setEntity(entity);
-
-               section_source = (SourceCollectionDetailSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.IDENTIFIABLE_SOURCE_COLLECTION,
-                                               getConversationHolder(), formElement, Section.TWISTIE);
-               section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               section_source.setEntity(entity);
-       }
+    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+        // Disable for now
+        // text_derivedUnitDefinitions =
+        // formFactory.createTextWithLabelElement(formElement,
+        // "Specimen Definition",
+        // facade.getDerivedUnitDefinition(CdmStore.getDefaultLanguage()),
+        // style);
+        text_barcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
+        text_catalogNumber = formFactory.createTextWithLabelElement(formElement, "Catalog Number", entity.getCatalogNumber(), style);
+
+        try {
+            combo_preservationMethod = formFactory.createTermComboElement(PreservationMethod.class, formElement, "Preservation Method", entity.getPreservationMethod(), style);
+        } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+            // we ignore this
+            AbstractUtility.info(e.getMessage());
+        }
+        selection_storedUnder = formFactory.createSelectionElement(TaxonNameBase.class, getConversationHolder(), formElement, "Stored Under", entity.getStoredUnder(), EntitySelectionElement.ALL, style);
+
+        try {
+            text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", entity.getExsiccatum(), style);
+        } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+            // we ignore this
+            AbstractUtility.info(e.getMessage());
+        }
+
+        section_duplicates = formFactory.createSpecimenCollectionDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_duplicates.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        section_duplicates.setEntity(entity);
+
+        section_source = formFactory.createSourceCollectionDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        section_source.setEntity(entity);
+    }
 
        /** {@inheritDoc} */
        @Override
@@ -142,7 +123,7 @@ public class DerivedUnitBaseDetailElement extends
                                getEntity().setPreservationMethod(
                                                combo_preservationMethod.getSelection());
                        } catch (MethodNotSupportedByDerivedUnitTypeException e) {
-                               StoreUtil
+                               AbstractUtility
                                                .errorDialog(
                                                                "MethodNotSupportedByDerivedUnitTypeException",
                                                                this,
@@ -155,7 +136,7 @@ public class DerivedUnitBaseDetailElement extends
                        try {
                                getEntity().setExsiccatum(text_exsicatum.getText());
                        } catch (Exception e) {
-                               StoreUtil.error(this.getClass(), e);
+                               AbstractUtility.error(this.getClass(), e);
                        }
                }
        }
index 7fdfd02f1cd44679b30ea2eef66fa6fd83a70ef2..ea4d184a0731542acc88c121967b88aedcd968c5 100644 (file)
@@ -1,21 +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.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.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -27,9 +26,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 public class DeterminationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
 
        private CurrentDeterminationDetailSection section_currentDetermination;
-       
+
        private DeterminationHistoryDetailSection section_determinationHistory;
-       
+
        /**
         * @param formFactory
         * @param formElement
@@ -45,21 +44,15 @@ public class DeterminationDetailElement extends AbstractCdmDetailElement<Derived
        @Override
        protected void createControls(ICdmFormElement formElement,
                        DerivedUnitFacade entity, int style) {
-               
-               section_currentDetermination = (CurrentDeterminationDetailSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.DETERMINATION_CURRENT,
-                                               getConversationHolder(), formElement, Section.EXPANDED);
-               section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               section_currentDetermination.setEntity(entity);
-               
-               section_determinationHistory = (DeterminationHistoryDetailSection) formFactory
-                                                                                       .createEntityDetailSection(
-                                                                                                       EntityDetailType.DETERMINATION_HISTORY,
-                                                                                                       getConversationHolder(), formElement, Section.TWISTIE);
-               section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               section_determinationHistory.setEntity(entity);
-               
+
+        section_currentDetermination = formFactory.createCurrentDeterminationDetailSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
+        section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        section_currentDetermination.setEntity(entity);
+
+        section_determinationHistory = formFactory.createDeterminationHistoryDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        section_determinationHistory.setEntity(entity);
+
        }
 
        /* (non-Javadoc)
index 0a4d04a81e661e8e5023df6591b06904dcf16bf5..f7d40c6d800f3b35385f157d575da28ca358c4db 100644 (file)
@@ -16,7 +16,6 @@ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
@@ -72,26 +71,18 @@ public class GatheringEventDetailElement extends
     @Override
     protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
         // collectingArea
-        number_absoluteElevationError = formFactory.createIntegerTextWithLabelElement(
-                formElement, "Elevation Error", entity.getAbsoluteElevationError(), style);
-        number_absoluteElevationMinimum = formFactory.createIntegerTextWithLabelElement(
-                formElement, "Elevation Minimum (m)", entity.getAbsoluteElevationMinimum(), style);
-        number_absoluteElevationMaximum = formFactory.createIntegerTextWithLabelElement(
-                formElement, "Elevation Maximum (m)", entity.getAbsoluteElevationMaximum(), style);
-
-        text_collectingMethod = formFactory.createTextWithLabelElement(
-                formElement, "Collecting Method", entity.getCollectingMethod(), style);
-
-        number_distanceToGround = formFactory.createIntegerTextWithLabelElement(
-                formElement, "Distance To Ground (m)", entity.getDistanceToGround(), style);
-        number_distanceToWaterSurface = formFactory.createIntegerTextWithLabelElement(
-                formElement, "Distance To Water Surface (m)", entity.getDistanceToWaterSurface(), style);
+        number_absoluteElevationError = formFactory.createIntegerTextWithLabelElement(formElement, "Elevation Error", entity.getAbsoluteElevationError(), style);
+        number_absoluteElevationMinimum = formFactory.createIntegerTextWithLabelElement(formElement, "Elevation Minimum (m)", entity.getAbsoluteElevationMinimum(), style);
+        number_absoluteElevationMaximum = formFactory.createIntegerTextWithLabelElement(formElement, "Elevation Maximum (m)", entity.getAbsoluteElevationMaximum(), style);
+
+        text_collectingMethod = formFactory.createTextWithLabelElement(formElement, "Collecting Method", entity.getCollectingMethod(), style);
+
+        number_distanceToGround = formFactory.createIntegerTextWithLabelElement(formElement, "Distance To Ground (m)", entity.getDistanceToGround(), style);
+        number_distanceToWaterSurface = formFactory.createIntegerTextWithLabelElement(formElement, "Distance To Water Surface (m)", entity.getDistanceToWaterSurface(), style);
         // exactLocation
-        text_gatheringEventDescription = formFactory.createTextWithLabelElement(
-                formElement, "Gathering Event Description", entity.getGatheringEventDescription(), style);
+        text_gatheringEventDescription = formFactory.createTextWithLabelElement(formElement, "Gathering Event Description", entity.getGatheringEventDescription(), style);
 
-        section_collectingAreas = (CollectingAreasDetailSection) formFactory.createEntityDetailSection(
-                EntityDetailType.COLLECTING_AREA, getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
         section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         section_collectingAreas.setEntity(entity);
     }
index 4fe9b9f42a321474a6af11e2560d2f83d5eb0661..6ae7c256f320f4c935e4903a460f251953297d65 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.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
@@ -262,8 +261,8 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         destroySections();
 
         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);
+        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(groupDetailSection);
         addPart(memberDetailSection);
@@ -317,19 +316,19 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent,ExpandableComposite.TWISTIE);
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -360,19 +359,19 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -444,11 +443,11 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionElementSourceSection descriptionElementSourceSection = (DescriptionElementSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionElementMediaSection descriptionElementMediaSection = (DescriptionElementMediaSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTMEDIA, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -472,15 +471,15 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescribedSpecimenSection describedSpecimenSection = (DescribedSpecimenSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIBED_SPECIMEN, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ScopeSection scopeSection = (ScopeSection) formFactory.createEntityDetailSection(EntityDetailType.SCOPE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -502,7 +501,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -594,7 +593,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory.createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
+        TaxonomicScopeSection taxonomicScopeSection = formFactory.createTaxonomicScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
 
         addPart(polytomousKeyDetailSection);
         addPart(polytomousKeyNodeDetailSection);
@@ -628,7 +627,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         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 = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(userDetailSection);
         addPart(groupByUserDetailSection);
index 36a2d9b31d1d79dd9f47cf61de05c6df849a1c0e..f48949c18565ae3590bca53d02502131bbac26e2 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,18 +16,17 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
-import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.VersionableEntity;
 import eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity;
 import eu.etaxonomy.taxeditor.model.IElementHasDetails;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.section.media.MediaSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseSection;
@@ -53,7 +52,7 @@ public class SupplementalDataViewer extends AbstractCdmDataViewer implements ISe
 
        private boolean showDebug;
 
-       
+
        /**
         * <p>Constructor for SupplementalDataViewer.</p>
         *
@@ -89,22 +88,22 @@ public class SupplementalDataViewer extends AbstractCdmDataViewer implements ISe
        /** {@inheritDoc} */
        @Override
        protected void showParts() {
-               
-               showDebug = PreferencesUtil.getPreferenceStore().getBoolean(PreferencesUtil.SHOW_DEBUG_INFORMATION);
-                               
+
+               showDebug = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_DEBUG_INFORMATION);
+
                Object input;
-               
+
                if(getInput() instanceof IElementHasDetails){
                        input = ((IElementHasDetails) getInput()).getData();
                }else{
                        input = getInput();
                }
-               
+
                destroySections();
                //1. Headline
                createHeadlineSection(rootElement);
                //2. Annotatable entitiy
-               if(input instanceof AnnotatableEntity){ 
+               if(input instanceof AnnotatableEntity){
                                createAnnotationSections(rootElement);
                }
                //3. Identifiable entity
@@ -113,17 +112,17 @@ public class SupplementalDataViewer extends AbstractCdmDataViewer implements ISe
                }
                //4. Identifiable media entity
                if(input instanceof IdentifiableMediaEntity){
-                       createIdentifiableMediaSections(rootElement);                   
+                       createIdentifiableMediaSections(rootElement);
                }
                //5. Versionable
                if(input instanceof VersionableEntity){
                                createVersionSection(rootElement);
-               }       
+               }
                //6. CdmBase
                if(showDebug){
                        createCdmBaseSection(rootElement);
                }
-               
+
                layout();
        }
 
@@ -133,86 +132,80 @@ public class SupplementalDataViewer extends AbstractCdmDataViewer implements ISe
                HeadlineSection headlineSection = formFactory.createHeadlineSection(parent);
                addPart(headlineSection);
        }
-       
-       private void createAnnotationSections(RootElement parent){
-               AnnotationSection annotationSection = (AnnotationSection) 
-                       formFactory.createEntityDetailSection(EntityDetailType.ANNOTATION, getConversationHolder(), parent, Section.TWISTIE);
-               
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               MarkerSection markerSection = (MarkerSection)
-                       formFactory.createEntityDetailSection(EntityDetailType.MARKER, getConversationHolder(), parent, Section.TWISTIE);
-               
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               addPart(annotationSection);
-               addPart(markerSection);
-       }
 
-       private void createIdentifiableSections(RootElement parent){            
-               CreditSection creditSection = (CreditSection) 
-                       formFactory.createEntityDetailSection(EntityDetailType.CREDIT, getConversationHolder(), parent, Section.TWISTIE);
-               
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               ExtensionSection extensionSection = (ExtensionSection) 
-                       formFactory.createEntityDetailSection(EntityDetailType.EXTENSION, getConversationHolder(), parent, Section.TWISTIE);
-               
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               RightsSection rightsSection = (RightsSection) 
-                       formFactory.createEntityDetailSection(EntityDetailType.RIGHTS, getConversationHolder(), parent, Section.TWISTIE);
-               
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               SourceSection sourceSection = (SourceSection)
-                       formFactory.createEntityDetailSection(EntityDetailType.SOURCE, getConversationHolder(), parent, Section.TWISTIE);
-               
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               addPart(creditSection);
-               addPart(extensionSection);
-               addPart(rightsSection);
-               addPart(sourceSection);
-               
-       }
-       
-       private void createIdentifiableMediaSections(RootElement parent){
-               MediaSection mediaSection = (MediaSection) 
-                       formFactory.createEntityDetailSection(EntityDetailType.MEDIA, getConversationHolder(), parent, Section.TWISTIE);
-               
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               addPart(mediaSection);
+    private void createAnnotationSections(RootElement parent) {
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        MarkerSection markerSection = formFactory.createMarkerSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(annotationSection);
+        addPart(markerSection);
+    }
+
+    private void createIdentifiableSections(RootElement parent) {
+        CreditSection creditSection = formFactory.createCreditSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        ExtensionSection extensionSection = formFactory.createExtensionSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        SourceSection sourceSection = formFactory.createSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(creditSection);
+        addPart(extensionSection);
+        addPart(rightsSection);
+        addPart(sourceSection);
+
        }
-       
-       private void createVersionSection(RootElement parent){          
-               VersionSection versionSection = formFactory.createVersionSection(parent, Section.NO_TITLE | Section.EXPANDED);
+
+    private void createIdentifiableMediaSections(RootElement parent) {
+        MediaSection mediaSection = formFactory.createMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(mediaSection);
+    }
+
+       private void createVersionSection(RootElement parent){
+               VersionSection versionSection = formFactory.createVersionSection(parent, ExpandableComposite.NO_TITLE | ExpandableComposite.EXPANDED);
                addPart(versionSection);
        }
-       
+
        /**
         * @param rootElement
         */
        private void createCdmBaseSection(RootElement parent) {
-               
-               CdmBaseSection cdmBaseSection = formFactory.createCdmBaseSection(parent, Section.NO_TITLE | Section.EXPANDED);
+
+               CdmBaseSection cdmBaseSection = formFactory.createCdmBaseSection(parent, ExpandableComposite.NO_TITLE | ExpandableComposite.EXPANDED);
                addPart(cdmBaseSection);
        }
-       
+
        /*
         * (non-Javadoc)
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        /** {@inheritDoc} */
-       public void selectionChanged(SelectionChangedEvent event) {
+       @Override
+    public void selectionChanged(SelectionChangedEvent event) {
                if(event.getSource() instanceof DetailsViewer){
                        if(event.getSelection() == CdmFormFactory.EMPTY_SELECTION){
                                setInput(null);
                                return;
                        }
-                       
-                       IStructuredSelection selection = (IStructuredSelection) event.getSelection(); 
+
+                       IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                        setInput(selection.getFirstElement());
                }
        }