Fixed Ticket #4557
authorAlexander Oppermann <a.oppermann@bgbm.org>
Thu, 16 Apr 2015 09:03:48 +0000 (09:03 +0000)
committerAlexander Oppermann <a.oppermann@bgbm.org>
Thu, 16 Apr 2015 09:03:48 +0000 (09:03 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java

index 67fc3ed3f1950e1ed770578336560bb23609c295..f57be84915bfcae1742dcbd873b2dad2ce3a50b4 100644 (file)
@@ -137,14 +137,19 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
        /** {@inheritDoc} */
        @Override
        public void changed(Object object) {
-               viewer.refresh();
-               //TODO: should be replaced with the possibility to set views dirty
-               // when we move to Eclipse 4
-               // take a look at ISaveblePart
-               if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
-                   ((BulkEditor) part).forceDirty();
-               }
-               super.changed(object);
+           viewer.expandToLevel(2);
+           viewer.refresh();
+           //TODO: should be replaced with the possibility to set views dirty
+           // when we move to Eclipse 4
+           // take a look at ISaveblePart
+           if(object != null){
+               StructuredSelection selection = new StructuredSelection(object);
+               viewer.setSelection(selection, true);
+           }
+           if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
+               ((BulkEditor) part).forceDirty();
+           }
+           super.changed(object);
        }
 
        /** {@inheritDoc} */