#5009 Fix post polytomous key delete operation event handling
authorCherian Mathew <c.mathew@bgbm.org>
Thu, 27 Aug 2015 16:11:02 +0000 (18:11 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Thu, 27 Aug 2015 16:11:02 +0000 (18:11 +0200)
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewPart.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RemotingDeletePolytomousKeyOperation.java

index 643d3aa8ee9c80c20746b016f9dcca61743ea83d..e6757a31ba5d57fcb2b4071587dab500ac2706a9 100644 (file)
@@ -318,8 +318,8 @@ public class PolytomousKeyViewPart extends ViewPart implements
      */
     @Override
     public void onChange(CdmChangeEvent event) {
-        if(event.getSourceType().equals(PolytomousKeyViewPart.class) && event.getAction() == Action.Delete) {
-            viewer.refresh();
+        if(event.getAction() == Action.Delete && PolytomousKey.class.equals(event.getEntityType())) {
+            refresh();
         }
 
     }
index d001dc69fc987f20352426d49de1de9a8636ae16..6551fe3b2f27d2b6e82ffb6f27cb6502ba1a1b69 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -49,6 +50,7 @@ public class RemotingDeletePolytomousKeyOperation extends RemotingCdmUpdateOpera
      */
     @Override
     protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        entityType = PolytomousKey.class;
         return CdmStore.getService(IPolytomousKeyService.class).delete(keysToDelete);
     }