- show recordBasis for specimens as part title of DetailsView
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 18 May 2015 12:45:08 +0000 (12:45 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 18 May 2015 12:45:08 +0000 (12:45 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java

index 71a7889eaebc6923622d596ae5d22d0488323e31..fdbc036b264912c1bdacb2c9e933617bee403060 100644 (file)
@@ -18,8 +18,10 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
@@ -101,6 +103,9 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
                if(selectedObject instanceof TreeNode){
                    selectedObject = ((TreeNode) selectedObject).getValue();
                }
+               if(selectedObject instanceof SpecimenOrObservationBase){
+                   return getViewName()+": "+HibernateProxyHelper.deproxy(selectedObject, SpecimenOrObservationBase.class).getRecordBasis();
+               }
                return getViewName()+": "+selectedObject.getClass().getSimpleName();
            }
            return getViewName();