- fixed title for Uses view part
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 27 Apr 2015 08:30:49 +0000 (08:30 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 27 Apr 2015 08:30:49 +0000 (08:30 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesViewPart.java

index 28bbbac06ebd09fe2087edb0016648da9506a8fb..f9541aa3ec5580324687e36ce093820a98c5ab85 100644 (file)
@@ -215,7 +215,7 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
        @Override
     protected void selectionChanged_internal(IWorkbenchPart part, ISelection selection) {
                if(AbstractUtility.getActiveEditor() == null){
-                   setPartName("Factual Data");
+                   setPartName(createPartTitle(null));
                        showEmptyPage();
                        return;
                }
@@ -244,16 +244,27 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                        && ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
                        && part instanceof IPartContentHasFactualData  && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && part instanceof BulkEditor)){
                    featureNodeContainerCache.clear();
-               setPartName("Factual Data: " + ((IStructuredSelection) selection).getFirstElement());
+               setPartName(createPartTitle(((IStructuredSelection) selection).getFirstElement()));
                    showViewer(part, (IStructuredSelection) selection);
                    return;
                }
                else{
-            setPartName("Factual Data");
+            setPartName(createPartTitle(null));
                    showEmptyPage();
                }
        }
 
+       protected String getViewName(){
+           return "Factual Data";
+       }
+
+       private String createPartTitle(Object selectedObject){
+           if(selectedObject!=null){
+               return getViewName()+": "+selectedObject;
+           }
+        return getViewName();
+       }
+
        /**
         *
         * @author n.hoffmann
index 63c9f5d0dd1f197466bfb4d06d142483d2ce2a01..addf51208649630a3eb3c057105745345895c97d 100644 (file)
@@ -66,6 +66,11 @@ public class UsesViewPart extends DescriptiveViewPart {
 \r
        }\r
 \r
+       @Override\r
+    protected String getViewName(){\r
+           return "Uses";\r
+       }\r
+\r
        /** {@inheritDoc} */\r
        @Override\r
        public boolean postOperation(CdmBase objectAffectedByOperation) {\r