commit 0d3d2e38f001e5dddaf2824d82afbfcd094702dd
Author: Katja Luther <k.luther@bgbm.org>
Date:   Wed Feb 20 09:55:31 2019 +0100

    ref #8088: fix TOE in edit taxon node wizard when changing taxon

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java
index da6902b6f..02e302c01 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java
@@ -8,10 +8,17 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.classification;
 
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.taxeditor.newWizard.IWizardPageListener;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -19,10 +26,12 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @date 23.03.2016
  *
  */
-public class EditTaxonNodeWizard extends AbstractEditWizard<TaxonNode> {
+public class EditTaxonNodeWizard extends AbstractEditWizard<TaxonNode> implements ICdmEntitySessionEnabled{
 
     private TaxonNodeWizardPage taxonNodePage;
     private IWizardPageListener wizardPageListener;
+    private ICdmEntitySession cdmEntitySession;
+
 
     /* (non-Javadoc)
      * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#getEntityName()
@@ -60,10 +69,41 @@ public class EditTaxonNodeWizard extends AbstractEditWizard<TaxonNode> {
     @Override
     public void setEntity(TaxonNode entity) {
         setWindowTitle(String.format("Edit %s", getEntityName()));
+        if (CdmStore.isActive() && cdmEntitySession == null) {
+
+            cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+            cdmEntitySession.bind();
+        }
         entity = CdmStore.getService(ITaxonNodeService.class).load(entity.getUuid());
         super.setEntity(entity);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+
+        return cdmEntitySession;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Collection<TaxonNode> getRootEntities() {
+        return Collections.singleton(this.getEntity());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
 
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
index c7bec26b3..529f0f9fc 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
@@ -265,6 +265,12 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<TaxonNode>
 		} else if (eventSource == selection_reuseExistingTaxon) {
 		    if (selection_reuseExistingTaxon.getEntity() != null){
 		        setTaxon(selection_reuseExistingTaxon.getEntity());
+		        if (getTaxon().getSec()!= null){
+		            textTaxonSec.setText((getTaxon().getSec().getTitleCache()));
+		        }else{
+		            textTaxonSec.setText("");
+		        }
+		        checkbox_publish.setSelected(getTaxon().isPublish());
             }
 			complete = true;
 		} else if (eventSource == selection_reuseExistingName) {
