moving taxonnode with drag & drop as predecessor fixed
authorU-BGBM\k.luther <k.luther@BGBM11732.bgbm.fu-berlin.de>
Thu, 3 Sep 2015 10:35:48 +0000 (12:35 +0200)
committerU-BGBM\k.luther <k.luther@BGBM11732.bgbm.fu-berlin.de>
Thu, 3 Sep 2015 10:35:48 +0000 (12:35 +0200)
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapter.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapterAssistant.java

index 2dd550d234c0525fbc83965ff270b1d2213844e7..e0f8a056682c00baa38a17452a86ab1df8f46d55 100644 (file)
@@ -235,9 +235,10 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
                                        logger.error("Workspace undo context is null. DND operation cancelled");
                                        return false;
                                }
+                               TaxonNode targetNode = (TaxonNode) targetITaxonTreeNode;
 
                                AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, false);
+                                               ("Move Taxon", workspaceUndoContext, uuids, targetNode.getParent(), this, taxonNavigator, false);
                                NavigationUtil.executeOperation(operation);
 
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
index cca66d57ca4c66abc0645594f2188558fa9d3d6d..289d9d1b99596249b0fc4da64faf594532475e2a 100644 (file)
@@ -225,9 +225,9 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                        logger.error("Workspace undo context is null. DND operation cancelled");
                                        return Status.CANCEL_STATUS;
                                }
-
+                               TaxonNode targetNode = (TaxonNode) targetITaxonTreeNode;
                                AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, false);
+                                               ("Move Taxon", workspaceUndoContext, uuids, targetNode.getParent(), this, taxonNavigator, false);
                                NavigationUtil.executeOperation(operation);
 
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);