- added section for associated taxa (IndividualsAssocation, TypeDesignation) to...
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / detail / DetailsViewer.java
index 219e158b6fc475e603af55b2c89f3665bef811c8..d21be346eec997c81abd91814396f2b8c5e15ead 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Set;
 
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
@@ -22,6 +23,7 @@ import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
@@ -34,7 +36,6 @@ import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 import eu.etaxonomy.cdm.model.media.Media;
@@ -51,7 +52,6 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
@@ -91,26 +91,25 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.EmptySection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDeterminationDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.OriginalLabelDataSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationCloningDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationGelPhotoCollectionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationPrimerDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceReferenceCollectionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadPherogramCollectionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.media.LivingPlantPhotoGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.media.SpecimenScanGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsSection;
 import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
 import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
@@ -165,13 +164,19 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     @Override
     public void setInput(Object input) {
+        if(input instanceof TreeNode){
+            input = ((TreeNode) input).getValue();
+        }
+        if(input instanceof GbifResponse){
+            input = ((GbifResponse) input).getDerivedUnitFacade();
+        }
         if (input.getClass().equals(DerivedUnit.class)) {
             DerivedUnit derivedUnit = (DerivedUnit)input;
             try {
                 input = DerivedUnitFacade.NewInstance(derivedUnit,
                         PreferencesUtil.getDerivedUnitConfigurator());
             } catch (DerivedUnitFacadeNotSupportedException e) {
-                AbstractUtility.error(getClass(), e);
+//                MessagingUtils.error(getClass(), e); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
             }
         }
         else if(input instanceof FieldUnit){
@@ -284,22 +289,21 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                 createDerivedUnitBaseElementSection(rootElement);
             }
             else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
-                createTissueSampleSection(rootElement);
-            }
-            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.StillImage){
-                createSpecimenScanSection(rootElement);
-            }
-            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.StillImage){
-                createLivingPlantPhotoSection(rootElement);
-            }
-            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.StillImage){
-                createMediaSpecimenSection(rootElement);
+                //TissueSample should only be created by using it's own class
+                //in future using only one class with different SpecimenOrObservationTypes is desired
+//                createTissueSampleSection(rootElement);
             }
             else{
                 createDerivedUnitBaseElementSection(rootElement);
             }
         } else if (input instanceof DnaSample){
-            createDnaSampleSection(rootElement);
+            DnaSample dnaSample = (DnaSample)input;
+            if(dnaSample.getRecordBasis()==SpecimenOrObservationType.TissueSample){
+                createTissueSampleSection(rootElement);
+            }
+            else if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
+                createDnaSampleSection(rootElement);
+            }
         } else if (input instanceof MediaSpecimen){
             createMediaSpecimenSection(rootElement);
         }
@@ -315,10 +319,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         else if (input instanceof FeatureNodeContainer) {
             createFeatureDistributionSection(rootElement);
 
-        } else if (input instanceof PolytomousKey) {
-            //createPolytomousKeySection(rootElement);
-
-        } else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
+        }else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
             createPolytomousKeyNodeSection(rootElement);
         } else if (input instanceof User) {
             createUserSection(rootElement);
@@ -331,7 +332,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         } else if (input instanceof DefinedTermBase) {
             createDefinedTermSection(rootElement);
         }
-        if(managedForm.getParts().length==0) {
+        else {
             createEmptySection(rootElement);
         }
         layout();
@@ -386,8 +387,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     @Override
     public void setSelection(ISelection selection, boolean reveal) {
         this.selection = selection;
-        SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
-        fireSelectionChanged(selectionChangedEvent);
+        if(this.selection!=null){
+            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
+            fireSelectionChanged(selectionChangedEvent);
+        }
     }
 
     /**
@@ -398,45 +401,47 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createTaxonSections(RootElement parent) {
         destroySections();
 
-        TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
+                ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
 
+        TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE     | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(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 = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE);
-
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        //TODO RL
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+                       addPart(protologSection);
+                       addPart(typeDesignationSection);
+                       addPart(nameRelationshipSection);
+        }
 
-        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
 
+        addPart(parsingMessagesSection);
         addPart(taxonBaseDetailSection);
         addPart(nonViralNameSection);
         addPart(nomenclaturalStatusSection);
-        addPart(protologSection);
         addPart(referenceDetailSection);
-        addPart(typeDesignationSection);
-        addPart(nameRelationshipSection);
-        addPart(parsingMessagesSection);
     }
 
     /**
@@ -446,36 +451,35 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createNameSections(RootElement parent) {
         destroySections();
-        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         addPart(nonViralNameSection);
         addPart(nomenclaturalStatusSection);
-        addPart(protologSection);
         addPart(referenceDetailSection);
-        addPart(typeDesignationSection);
-        addPart(nameRelationshipSection);
+//TODO RL
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                       ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+               addPart(protologSection);
+               addPart(typeDesignationSection);
+               addPart(nameRelationshipSection);
+        }
     }
 
     /**
@@ -486,7 +490,8 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createReferenceSections(RootElement parent) {
         destroySections();
 
-        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(referenceDetailSection);
     }
@@ -651,32 +656,51 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createDerivedUnitBaseElementSection(RootElement parent) {
         destroySections();
 
-        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        //different order of sections (Specimen Details as second section and expanded)
+        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
+            DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+            addPart(derivedUnitGeneralDetailSection);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+            addPart(derivedUnitBaseDetailSection);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            OriginalLabelDataSection originalLabelDataSection = formFactory.createOriginalLabelDataSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+            addPart(originalLabelDataSection);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+            addPart(taxonAssociationDetailSection);
+        }
+        else{
+            DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+            addPart(derivedUnitGeneralDetailSection);
 
-        addPart(derivedUnitGeneralDetailSection);
-        addPart(gatheringEventDetailSection);
-        addPart(fieldUnitDetailSection);
-        addPart(derivedUnitBaseDetailSection);
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            addPart(gatheringEventDetailSection);
+
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            addPart(fieldUnitDetailSection);
+
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+            DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            addPart(derivedUnitBaseDetailSection);
 
-        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
             DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
             addPart(determinationDetailSection);
         }
 
-
     }
 
     private void createFieldUnitSection(RootElement parent) {
@@ -703,30 +727,17 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         }
     }
 
-    private void createPreservedSpecimenSpecimenSection(RootElement parent) {
+    private void createTissueSampleSection(RootElement parent) {
         destroySections();
 
-        PreservedSpecimenGeneralDetailSection section = formFactory.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        PreservedSpecimenDetailSection derivedUnitBaseDetailSection = formFactory.createPreservedSpecimenDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        PreservedSpecimenDeterminationDetailSection determinationDetailSection = formFactory.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
-        addPart(section);
-        addPart(derivedUnitBaseDetailSection);
-        addPart(determinationDetailSection);
-    }
-
-    private void createTissueSampleSection(RootElement parent) {
-        destroySections();
-
-        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(section);
+        addPart(sampleDesignationDetailSection);
     }
 
     private void createDnaSampleSection(RootElement parent) {
@@ -738,8 +749,13 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
         addPart(section);
         addPart(qualitySection);
+        addPart(sampleDesignationDetailSection);
     }
 
     private void createAmplificationSection(RootElement parent) {
@@ -748,11 +764,11 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        AmplificationPrimerDetailSection primerSection = formFactory.createAmplificationPrimerDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+        AmplificationPrimerDetailSection primerSection = formFactory.createAmplificationPrimerDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        AmplificationCloningDetailSection cloningSection = formFactory.createAmplificationCloningDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+        AmplificationCloningDetailSection cloningSection = formFactory.createAmplificationCloningDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -797,25 +813,17 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(pherogramSection);
     }
 
-    private void createSpecimenScanSection(RootElement parent) {
+    private void createMediaSpecimenSection(RootElement parent) {
         destroySections();
-        SpecimenScanGeneralDetailSection section = formFactory.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
-        addPart(section);
-    }
-
-    private void createLivingPlantPhotoSection(RootElement parent) {
-        destroySections();
-        LivingPlantPhotoGeneralDetailSection section = formFactory.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        addPart(generalSection);
 
-        addPart(section);
-    }
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-    private void createMediaSpecimenSection(RootElement parent) {
-        destroySections();
-        MediaSpecimenGeneralDetailSection section = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        addPart(rightsSection);
 
-        addPart(section);
     }