- list "Specimen Details" second in DetailsView (only for campanula, fixes #4235)
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / detail / DetailsViewer.java
index ff81684c198b7ee5d7bbce48e1e6077f9c3a007c..fd3f541059ad34b91579e7be6a1cf0beecef0c25 100644 (file)
@@ -655,24 +655,47 @@ 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);
+            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            addPart(gatheringEventDetailSection);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            addPart(fieldUnitDetailSection);
+        }
+        else{
+            DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+            addPart(derivedUnitGeneralDetailSection);
+
+            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);
+        }
 
-        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
-        addPart(derivedUnitGeneralDetailSection);
-        addPart(gatheringEventDetailSection);
-        addPart(fieldUnitDetailSection);
-        addPart(derivedUnitBaseDetailSection);
 
         if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);