Added supplemental data related to Polytomous Keys, corresponding to those for object...
authorCherian Mathew <c.mathew@bgbm.org>
Fri, 19 Oct 2012 15:09:12 +0000 (15:09 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Fri, 19 Oct 2012 15:09:12 +0000 (15:09 +0000)
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/SupplementalDataViewPart.java

index 3f2143547b412ac6ebe34ddfeb64f69242fdf8b4..5793674d4469d67a9ab8ce710fff4edd54fd92b6 100644 (file)
@@ -237,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)) {
@@ -720,7 +720,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
                 .createCdmDetailSection(DetailType.POLYTOMOUS_KEY,
                         getConversationHolder(), parent, this, Section.TWISTIE
-                                | Section.COMPACT);
+                               | Section.COMPACT);
         
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         
@@ -729,29 +729,30 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                         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);        
+//        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);
+           addPart(polytomousKeyNodeDetailSection);
+//         addPart(geographicalScopeDetailSection);
+//         addPart(scopeRestrictionSection);
+//         addPart(taxonomicScopeSection);
+
        }
        
        /**
index 8dc4e14297f79439018ea1a35bbc4d312c628b03..28ad2a86ccae86972e3b8c010b76d25c8c00c8a3 100644 (file)
@@ -12,16 +12,19 @@ package eu.etaxonomy.taxeditor.view.supplementaldata;
 
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.part.EditorPart;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
+import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
 
 
 /**
@@ -70,7 +73,9 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
                        if(structuredSelection.getFirstElement() instanceof DerivedUnitFacade){
                                return;
                        }
-                       
+                       if(structuredSelection.getFirstElement() instanceof PolytomousKeyNode){
+                           structuredSelection = new StructuredSelection(((PolytomousKeyNode)structuredSelection.getFirstElement()).getKey());
+            }
                        showViewer(part, structuredSelection);
                }else{
                        showEmptyPage();