Add check for remoting before setting new entity listener
authorCherian Mathew <c.mathew@bgbm.org>
Mon, 5 Oct 2015 13:05:23 +0000 (15:05 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Mon, 5 Oct 2015 13:05:48 +0000 (15:05 +0200)
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java

index 1251d3325c3edd00e8a72c9de0dc9b36e54ce826..bcd6dff64c1f299e085c1b9a705f8715b7daf988 100644 (file)
@@ -45,7 +45,6 @@ public class CdmApplicationState {
     public static CdmApplicationState getInstance() {
         if(cdmApplicationState == null) {
             cdmApplicationState = new CdmApplicationState();
-            CdmBase.setNewEntityListener(new DefaultNewEntityListener());
         }
 
         return cdmApplicationState;
@@ -53,6 +52,11 @@ public class CdmApplicationState {
 
     public void setAppConfig(ICdmApplicationConfiguration appConfig) {
         this.appConfig = appConfig;
+        if(appConfig instanceof CdmApplicationRemoteController) {
+            CdmBase.setNewEntityListener(new DefaultNewEntityListener());
+        } else {
+            CdmBase.setNewEntityListener(null);
+        }
     }
 
     public ICdmApplicationConfiguration getAppConfig() {