reordered sections in detail view
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / detail / DetailsViewer.java
index f4c2c58051ebf20cfed6d2ea370d3939f8cabd2f..3f2143547b412ac6ebe34ddfeb64f69242fdf8b4 100644 (file)
@@ -1,3 +1,4 @@
+
 // $Id$
 /**
  * Copyright (C) 2011 EDIT
@@ -169,6 +170,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
        /** {@inheritDoc} */
        @Override
        protected void showParts() {
+           // FIXME (CM) : Need to clean out this code.
+           // Too much type checking to decide which detail view to display.
+           // Need to build in a mechanism where navigators / editors are 'aware'
+           // of the corresponding detail viewer.
                if (getInput() instanceof TaxonBase) {
                        createTaxonSections(rootElement);
 
@@ -712,11 +717,40 @@ public class DetailsViewer extends AbstractCdmDataViewer {
        private void createPolytomousKeyNodeSection(RootElement parent) {
                destroySections();
 
-               PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
+        PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
+                .createCdmDetailSection(DetailType.POLYTOMOUS_KEY,
+                        getConversationHolder(), parent, this, Section.TWISTIE
+                                | Section.COMPACT);
+        
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+        
+        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection) formFactory
+                .createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE,
+                        getConversationHolder(), parent, this, Section.TWISTIE
+                                | Section.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection) formFactory
+                .createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE,
+                        getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection) formFactory
+                .createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION,
+                        getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory
+                .createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE,
+                        getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);        
 
+           addPart(polytomousKeyDetailSection);
+           addPart(geographicalScopeDetailSection);
+           addPart(scopeRestrictionSection);
+           addPart(taxonomicScopeSection);
                addPart(polytomousKeyNodeDetailSection);
        }