- fixed class cast exception
authorPatric Plitzner <p.plitzner@bgbm.org>
Thu, 19 Jun 2014 12:38:25 +0000 (12:38 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Thu, 19 Jun 2014 12:38:25 +0000 (12:38 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java

index 37ae4fd92cc94c8f0fb775c1b8f8d8f0e1c18a3d..ecb9c065466e2befa5d5eed67fe4ff7929af13b6 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.part.EditorPart;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -89,6 +90,9 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
                        else if(structuredSelection.getFirstElement() instanceof TreeNode){
                                structuredSelection = new StructuredSelection(((TreeNode)structuredSelection.getFirstElement()).getValue());
                        }
+                       else if(structuredSelection.getFirstElement() instanceof GbifResponse){
+                           structuredSelection = new StructuredSelection(((GbifResponse)structuredSelection.getFirstElement()).getDerivedUnitFacade().innerDerivedUnit());
+                       }
                        showViewer(part, structuredSelection);
                }else{
                        showEmptyPage();