setSelection in bulkeditor only if the model contains the selected object
authorKatja Luther <k.luther@bgbm.org>
Tue, 3 Jul 2018 09:07:14 +0000 (11:07 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 4 Jul 2018 11:09:45 +0000 (13:09 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java

index 3b93f62aec2c79bd0f3f014167a39b56632a95cc..56c40e40b85d12f0b8b0e6456c207b1551fea451 100644 (file)
@@ -412,6 +412,8 @@ public class BulkEditorE4 implements IPartContentHasDetails, IConversationEnable
     @Optional
     @Inject
     private void updateAfterSearch(@UIEventTopic(WorkbenchEventConstants.BULK_EDITOR_SEARCH_FINISHED)IStructuredSelection selection){
+
+
         if(selection!=null){
             setSelection(selection);
         }
@@ -445,7 +447,8 @@ public class BulkEditorE4 implements IPartContentHasDetails, IConversationEnable
     public void setSelection(IStructuredSelection selection){
         Object[] objects = selection.toArray();
         for (Object object : objects) {
-            if(object instanceof CdmBase){
+
+            if(object instanceof CdmBase &&  input.getModel().contains(object)){
                 bodyLayer.getSelectionLayer().selectRow(0, bodyDataProvider.indexOfRowObject((CdmBase) object), false, false);
             }
         }