commit 5354f6936314cfe1f547abf11ab0a259d7f4134b
Author: U-BGBM\k.luther <k.luther@BGBM11732.bgbm.fu-berlin.de>
Date:   Wed Sep 23 13:21:17 2015 +0200

    fix delete of taxon which is in two classifications and has children

diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
index f8e789caf..157286a64 100644
--- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
+++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
@@ -81,12 +81,15 @@ public class DeleteHandler extends AbstractHandler{
 		}
 		AbstractPostOperation operation = null;
 		TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+		config.setDeleteInAllClassifications(false);
+
 		if (treeNodes.size() == 1 ){
 			try {
 
 				ITaxonTreeNode treeNode = treeNodes.iterator().next();
 				ITaxonTreeNode taxonNode =treeNode;
 				TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
+
 				//configNodes.setDeleteTaxon(false);
 				if (taxonNode instanceof Classification && taxonNode.hasChildNodes()){
 					if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification? The tree has children, they will be deleted, too.")){
@@ -107,17 +110,17 @@ public class DeleteHandler extends AbstractHandler{
                                 "Do you really want to delete the selected node? It has childnodes, they will be deleted, too.",
                                 MessageDialog.WARNING, new String[] { "Delete all children",
                                         "Move children to parent node", "Skip" }, 0);
-						int result = dialog.open();
+						int dialog_result = dialog.open();
 
-						if (result == 0){
+						if (dialog_result == 0){
 							//delete all children
 							configNodes.setChildHandling(ChildHandling.DELETE);
 							config.setTaxonNodeConfig(configNodes);
-						} else if (result == 1){
+						} else if (dialog_result == 1){
 							//move children
 							configNodes.setChildHandling(ChildHandling.MOVE_TO_PARENT);
 							config.setTaxonNodeConfig(configNodes);
-						} else if (result == 2){
+						} else if (dialog_result == 2){
 							//skip
 							return null;
 
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java
index b9c5e9dd3..d427aba71 100644
--- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java
+++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java
@@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
@@ -73,18 +72,20 @@ public class ChangeAcceptedTaxonToSynonymOperation extends
 
 		monitor.worked(20);
 		bind();
-    	Taxon oldTaxon = (Taxon) HibernateProxyHelper.deproxy(((TaxonNode) taxonNode).getTaxon());
+    	Taxon oldTaxon = HibernateProxyHelper.deproxy(((TaxonNode) taxonNode).getTaxon(), Taxon.class);
+    	Taxon newAcceptedTaxon = HibernateProxyHelper.deproxy(newAcceptedTaxonNode.getTaxon(), Taxon.class);
+
 		try {
 		    DeleteResult result = CdmStore.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode((TaxonNode) taxonNode, newAcceptedTaxonNode, null, null, null);
-        
+
 		    if (!result.getExceptions().isEmpty() && result.isOk()){
 		    	String separator = ", ";
 			    String exceptionString = "";
 			    for (Exception exception : result.getExceptions()) {
 		            exceptionString += exception.getLocalizedMessage()+separator;
 		        }
-				
-		    	MessagingUtils.informationDialog("Synonym created but taxon is not deleted.", exceptionString);		    	
+
+		    	MessagingUtils.informationDialog("Synonym created but taxon is not deleted.", exceptionString);
 		    } else if (result.isAbort() || result.isError()){
 		    	MessagingUtils.errorDialog("Synonym could not created", null, result.toString(), TaxeditorNavigationPlugin.PLUGIN_ID, null, true);
 		    }
@@ -92,7 +93,7 @@ public class ChangeAcceptedTaxonToSynonymOperation extends
             MessagingUtils.errorDialog("Operation failed", this, e.getMessage(), TaxeditorNavigationPlugin.PLUGIN_ID, e, false);
             return Status.CANCEL_STATUS;
         }
-		
+
 		monitor.worked(40);
 
 		return postExecute(oldTaxon);
