merge of trunk to the security branch
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / detail / DetailsViewer.java
index 2e82a19679280392d70fd2cf582616d8d757cfd8..05574f256d9b3b978863a0b3d6d911fff101236d 100644 (file)
@@ -1,3 +1,4 @@
+
 // $Id$
 /**
  * Copyright (C) 2011 EDIT
@@ -66,7 +67,7 @@ import eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection;
 import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageSection;
 import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection;
 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.group.GrantedAuthorityDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection;
@@ -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);
 
@@ -232,7 +237,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                        createFeatureDistributionSection(rootElement);
 
                } else if (getInput() instanceof PolytomousKey) {
-                       createPolytomousKeySection(rootElement);
+                       //createPolytomousKeySection(rootElement);
 
                } else if ((getInput() instanceof PolytomousKeyNode)
                                || (getInput() instanceof PolytomousKeyRelationship)) {
@@ -712,12 +717,42 @@ 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(polytomousKeyNodeDetailSection);
+//         addPart(geographicalScopeDetailSection);
+//         addPart(scopeRestrictionSection);
+           addPart(taxonomicScopeSection);
 
-               addPart(polytomousKeyNodeDetailSection);
        }
        
        /**