fix #6342: fix exception when using ? in selection dialog
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / operation / RemotingCdmOperation.java
index b47560fa4f5d4349abc00054c7c88adabebd71be..cf5dcd9839a80dbab74be1b3200bb33ab4ac4d0e 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2015 EDIT
 * European Distributed Institute of Taxonomy
@@ -33,6 +32,7 @@ public abstract class RemotingCdmOperation extends AbstractOperation {
     private final Object source;
     private final Action action;
     private final boolean async;
+    protected Class entityType;
 
     public RemotingCdmOperation(String label, Action action, Object source, boolean async) {
         super(label);
@@ -58,7 +58,7 @@ public abstract class RemotingCdmOperation extends AbstractOperation {
 
     protected abstract IStatus onComplete(boolean success);
 
-    protected void fireDataChangeEvent(Set<? extends CdmBase> changedObjects) {
+    protected void fireDataChangeEvent(Set<CdmBase> changedObjects) {
         if(changedObjects != null && !changedObjects.isEmpty()) {
             CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, changedObjects, source.getClass()), async);
         }
@@ -66,8 +66,13 @@ public abstract class RemotingCdmOperation extends AbstractOperation {
 
     protected void fireDataChangeEvent(UpdateResult updateResult) {
         Set<CdmBase> updatedObjects = updateResult.getUpdatedObjects();
-        if(updatedObjects != null && !updatedObjects.isEmpty()) {
-            CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, updatedObjects, source.getClass()), async);
+        CdmApplicationState.getCurrentDataChangeService()
+            .fireChangeEvent(new CdmChangeEvent(action, updatedObjects, source.getClass(), entityType), async);
+    }
+
+    protected void fireDataChangeEvent(CdmBase cdmBase) {
+        if(cdmBase != null) {
+            CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, cdmBase, source.getClass()), async);
         }
     }