Pre-select current classification for taxon node selection dialog
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 21 Sep 2015 15:50:25 +0000 (17:50 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 22 Sep 2015 08:01:21 +0000 (10:01 +0200)
(#3462)

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeSynonymToAcceptedTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/MoveSynonymToAnotherAcceptedTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionToOtherTaxonHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveFactualDataHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveTaxonHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java

index e76b8475e3a91bd43d8587fadb357dc6e94bd129..b25601b2140be37ca18662564753276f0c382d4e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -51,16 +51,17 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
        private static final Logger logger = Logger
                        .getLogger(ChangeSynonymToAcceptedTaxonHandler.class);
        private MultiPageTaxonEditor editor;
        private static final Logger logger = Logger
                        .getLogger(ChangeSynonymToAcceptedTaxonHandler.class);
        private MultiPageTaxonEditor editor;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
                editor =  (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);
                Shell shell = HandlerUtil.getActiveShell(event);
                IEditorInput input = editor.getEditorInput();
                editor =  (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);
                Shell shell = HandlerUtil.getActiveShell(event);
                IEditorInput input = editor.getEditorInput();
-               
+
                if (!(input instanceof TaxonEditorInput)) {
                        logger.error("Editor input is not TaxonEditorInput");
                        return null;
                if (!(input instanceof TaxonEditorInput)) {
                        logger.error("Editor input is not TaxonEditorInput");
                        return null;
@@ -74,7 +75,7 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
                }
 
                Synonym synonym = (Synonym) selection.getFirstElement();
                }
 
                Synonym synonym = (Synonym) selection.getFirstElement();
-               
+
                // Force user to save taxon - not really necessary though, is it?
                if (!EditorUtil.forceUserSave(editor, shell)) {
                        return null;
                // Force user to save taxon - not really necessary though, is it?
                if (!EditorUtil.forceUserSave(editor, shell)) {
                        return null;
@@ -82,25 +83,25 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
 
                // Get taxon
                Taxon taxon = ((TaxonEditorInput) input).getTaxon();
 
                // Get taxon
                Taxon taxon = ((TaxonEditorInput) input).getTaxon();
-               
+
                TaxonNode parentNode = (TaxonNode) HibernateProxyHelper.deproxy(((TaxonEditorInput) input).getTaxonNode().getParent());
                TaxonNode parentNode = (TaxonNode) HibernateProxyHelper.deproxy(((TaxonEditorInput) input).getTaxonNode().getParent());
-               
+
                List<UUID> excludeTaxa = null;
                List<UUID> excludeTaxa = null;
-               
-               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select parent", excludeTaxa, null, null);
-               
+
+               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select parent", excludeTaxa, null, ((TaxonEditorInput) input).getTaxonNode().getClassification());
+
                if(newParentNode != null){
                if(newParentNode != null){
-                       
+
                        // TODO get synonyms from homotypical group and add them as homotypic synonyms to new accepted taxon
                        // apply confirmation dialog
                        HomotypicalGroup group = synonym.getHomotypicGroup();
                        Set<TaxonNameBase> namesInGroup = group.getTypifiedNames();
                        // FIXME with this implementation we can not create a taxonNode that is a direct child of the classification node
                        // TODO get synonyms from homotypical group and add them as homotypic synonyms to new accepted taxon
                        // apply confirmation dialog
                        HomotypicalGroup group = synonym.getHomotypicGroup();
                        Set<TaxonNameBase> namesInGroup = group.getTypifiedNames();
                        // FIXME with this implementation we can not create a taxonNode that is a direct child of the classification node
-                       AbstractPostOperation operation = new ChangeSynonymToAcceptedTaxonOperation("Change synonym to accepted taxon", EditorUtil.getUndoContext(), 
+                       AbstractPostOperation operation = new ChangeSynonymToAcceptedTaxonOperation("Change synonym to accepted taxon", EditorUtil.getUndoContext(),
                                        taxon, newParentNode, synonym, namesInGroup, this, editor); //$NON-NLS-1$
                        EditorUtil.executeOperation(operation);
                }
                                        taxon, newParentNode, synonym, namesInGroup, this, editor); //$NON-NLS-1$
                        EditorUtil.executeOperation(operation);
                }
-               
+
                return null;
        }
 
                return null;
        }
 
@@ -108,19 +109,20 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
         * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
         */
        /** {@inheritDoc} */
         * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
         */
        /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
-               
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
+
                // Redraw existing editor
                ((IPostOperationEnabled) editor).postOperation(null);
                // Redraw existing editor
                ((IPostOperationEnabled) editor).postOperation(null);
-               
+
                editor.doSave(EditorUtil.getMonitor());
                editor.doSave(EditorUtil.getMonitor());
-               
+
                if (objectAffectedByOperation instanceof TaxonNode) {
                if (objectAffectedByOperation instanceof TaxonNode) {
-               
+
                        // Open new unsaved editor with existing taxon's parent as temporary parent
                        TaxonNode newNode = (TaxonNode) objectAffectedByOperation;
 //                     TaxonNode newNode = parentNode.addChild(newTaxon);
                        // Open new unsaved editor with existing taxon's parent as temporary parent
                        TaxonNode newNode = (TaxonNode) objectAffectedByOperation;
 //                     TaxonNode newNode = parentNode.addChild(newTaxon);
-                                       
+
                        try {
                                // TODO
                                /*
                        try {
                                // TODO
                                /*
@@ -129,7 +131,7 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
                                 *  doesn't work yet.
                                 */
                                EditorUtil.openTaxonNode(newNode.getUuid());
                                 *  doesn't work yet.
                                 */
                                EditorUtil.openTaxonNode(newNode.getUuid());
-                               
+
                        } catch (PartInitException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (PartInitException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
@@ -145,7 +147,8 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
         *
         * @return a boolean.
         */
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                // TODO Auto-generated method stub
                return false;
        }
                // TODO Auto-generated method stub
                return false;
        }
index 82198663a13e18411e7dee7eccfc8ae0b623af0d..b2c7b64532116f49938fa32c2d68de829fee13ce 100644 (file)
@@ -1,82 +1,78 @@
-package eu.etaxonomy.taxeditor.editor.name.handler;\r
-\r
-import java.util.UUID;\r
-\r
-import org.apache.log4j.Logger;\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.core.commands.common.NotDefinedException;\r
-import org.eclipse.core.commands.operations.IUndoContext;\r
-import org.eclipse.jface.dialogs.MessageDialog;\r
-import org.eclipse.jface.viewers.StructuredSelection;\r
-import org.eclipse.swt.widgets.Shell;\r
-import org.eclipse.ui.IEditorInput;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-\r
-import eu.etaxonomy.cdm.model.common.CdmBase;\r
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
-import eu.etaxonomy.cdm.model.taxon.Synonym;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
-import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;\r
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;\r
-import eu.etaxonomy.taxeditor.editor.name.operation.MoveSynonymToAnotherAcceptedTaxonOperation;\r
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
-import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;\r
-\r
-public class MoveSynonymToAnotherAcceptedTaxonHandler extends AbstractHandler implements IPostOperationEnabled {\r
-       private static final Logger logger = Logger\r
-       .getLogger(MoveSynonymToAnotherAcceptedTaxonHandler.class);\r
-       private MultiPageTaxonEditor editor;\r
-       \r
-       @Override\r
-       public Object execute(ExecutionEvent event) throws ExecutionException {\r
-               editor =  (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);\r
-               Shell shell = HandlerUtil.getActiveShell(event);\r
-               IEditorInput input = editor.getEditorInput();\r
-               if (!EditorUtil.forceUserSave(editor, shell)) {\r
-                       return null;\r
-               }\r
-               \r
-               if (!(input instanceof TaxonEditorInput)) {\r
-                       logger.error("Editor input is not TaxonEditorInput");\r
-                       return null;\r
-               }\r
-\r
-               // Get synonym from selection\r
-               StructuredSelection selection = (StructuredSelection) HandlerUtil.getCurrentSelection(event);\r
-               if (!(selection.getFirstElement() instanceof Synonym)) {\r
-                       logger.error("Selection does not contain a Synonym");\r
-                       return null;\r
-               }\r
-\r
-               Synonym synonym = (Synonym) selection.getFirstElement();\r
-               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select new accepted taxon", null, null, null);\r
-               Taxon oldParent = ((TaxonEditorInput)input).getTaxon();\r
-       \r
-                       MoveSynonymToAnotherAcceptedTaxonOperation operation = new MoveSynonymToAnotherAcceptedTaxonOperation("Change accepted Taxon of Synonym", EditorUtil.getUndoContext(),\r
-                                       oldParent.getUuid(), synonym.getUuid(), newParentNode.getTaxon(), editor);\r
-                       \r
-                       EditorUtil.executeOperation(operation);\r
-       \r
-\r
-               return null;\r
-       }\r
-\r
-       @Override\r
-       public boolean postOperation(CdmBase objectAffectedByOperation) {\r
-               // TODO Auto-generated method stub\r
-               return false;\r
-       }\r
-\r
-       @Override\r
-       public boolean onComplete() {\r
-               // TODO Auto-generated method stub\r
-               return false;\r
-       }\r
-       \r
-       \r
-\r
-}\r
+package eu.etaxonomy.taxeditor.editor.name.handler;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.name.operation.MoveSynonymToAnotherAcceptedTaxonOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
+
+public class MoveSynonymToAnotherAcceptedTaxonHandler extends AbstractHandler implements IPostOperationEnabled {
+       private static final Logger logger = Logger
+       .getLogger(MoveSynonymToAnotherAcceptedTaxonHandler.class);
+       private MultiPageTaxonEditor editor;
+
+       @Override
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               editor =  (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);
+               Shell shell = HandlerUtil.getActiveShell(event);
+               IEditorInput input = editor.getEditorInput();
+               if (!EditorUtil.forceUserSave(editor, shell)) {
+                       return null;
+               }
+
+               if (!(input instanceof TaxonEditorInput)) {
+                       logger.error("Editor input is not TaxonEditorInput");
+                       return null;
+               }
+
+               // Get synonym from selection
+               StructuredSelection selection = (StructuredSelection) HandlerUtil.getCurrentSelection(event);
+               if (!(selection.getFirstElement() instanceof Synonym)) {
+                       logger.error("Selection does not contain a Synonym");
+                       return null;
+               }
+
+               Synonym synonym = (Synonym) selection.getFirstElement();
+               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select new accepted taxon", null, null, ((TaxonEditorInput)input).getTaxonNode().getClassification());
+               if(newParentNode!=null){
+                   Taxon oldParent = ((TaxonEditorInput)input).getTaxon();
+
+                   MoveSynonymToAnotherAcceptedTaxonOperation operation = new MoveSynonymToAnotherAcceptedTaxonOperation("Change accepted Taxon of Synonym", EditorUtil.getUndoContext(),
+                           oldParent.getUuid(), synonym.getUuid(), newParentNode.getTaxon(), editor);
+
+                   AbstractUtility.executeOperation(operation);
+
+               }
+               return null;
+       }
+
+       @Override
+       public boolean postOperation(CdmBase objectAffectedByOperation) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public boolean onComplete() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+
+
+}
index c4b57e9cb4629968822bd35d951b0bbb9c407a00..281a1a22af684ee17f216d801181d1d9dc679a18 100644 (file)
@@ -22,10 +22,12 @@ import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.Page;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -74,7 +76,7 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
                                }       else if (element instanceof DescriptionBase){
                                        uuid = ((DescriptionBase)element).getUuid();
                                }
                                }       else if (element instanceof DescriptionBase){
                                        uuid = ((DescriptionBase)element).getUuid();
                                }
-                               
+
                                if (uuid != null){
                                        descriptions.add((TaxonDescription) CdmStore.getService(IDescriptionService.class).load(uuid, null));
                                }
                                if (uuid != null){
                                        descriptions.add((TaxonDescription) CdmStore.getService(IDescriptionService.class).load(uuid, null));
                                }
@@ -87,12 +89,21 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
                        List<UUID> excludeTaxa = new ArrayList<UUID>();
                        editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
                        excludeTaxa.add(descriptions.get(0).getTaxon().getUuid());
                        List<UUID> excludeTaxa = new ArrayList<UUID>();
                        editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
                        excludeTaxa.add(descriptions.get(0).getTaxon().getUuid());
+
+                       //get current taxon node
+                       TaxonNode node = null;
+                       Classification classification = null;
+                       MultiPageTaxonEditor taxonEditor = EditorUtil.getActiveMultiPageTaxonEditor();
+            if(taxonEditor!=null){
+                node = ((TaxonEditorInput) taxonEditor.getEditorInput()).getTaxonNode();
+                classification = node.getClassification();
+            }
                        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
                                        editor.getConversationHolder(),
                                        "Choose the accepted taxon",
                                        excludeTaxa,
                        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
                                        editor.getConversationHolder(),
                                        "Choose the accepted taxon",
                                        excludeTaxa,
-                                       null,
-                                       null);
+                                       node,
+                                       classification);
 
                        if (newAcceptedTaxonNode == null) {
                                return null;
 
                        if (newAcceptedTaxonNode == null) {
                                return null;
index d89a11fda672cc994a353abcbc617d7d0460bee3..7249dc198aedd5d54b52b1ffe6179db13219509f 100644 (file)
@@ -69,8 +69,8 @@ public class MoveFactualDataHandler extends AbstractHandler {
                             navigator.getConversationHolder(),
                             "Choose the accepted taxon",
                             excludeTaxa,
                             navigator.getConversationHolder(),
                             "Choose the accepted taxon",
                             excludeTaxa,
-                            null,
-                            null);
+                            sourceTaxonNode,
+                            sourceTaxonNode.getClassification());
                     if (dialogTaxonNode == null) {
                         return null;
                     }
                     if (dialogTaxonNode == null) {
                         return null;
                     }
index a761433ad4462b238d487c9d39d809ea973cc21b..9cc52f1b9aed1428ce1abe5a31e40e07d89ba19e 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
@@ -84,14 +85,15 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
 
 //             TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
                if (taxonNodes.size() >= 1){
 
 //             TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
                if (taxonNodes.size() >= 1){
+                   Classification classification = taxonNodes.iterator().next().getClassification();
                        boolean moveToNewParent = true;
                        if (PreferencesUtil.getSortNodesNaturally()){
                                if(!MessageDialog.openQuestion(null, "Target node", "The choosen target node should be the parent?")){
                                        moveToNewParent = false;
                                }
                        boolean moveToNewParent = true;
                        if (PreferencesUtil.getSortNodesNaturally()){
                                if(!MessageDialog.openQuestion(null, "Target node", "The choosen target node should be the parent?")){
                                        moveToNewParent = false;
                                }
-                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose the taxon above the moved taxon.", excludeTaxa, null, null);
+                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose the taxon above the moved taxon.", excludeTaxa, null, classification);
                        }else{
                        }else{
-                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose new parent", excludeTaxa, null, null);
+                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose new parent", excludeTaxa, null, classification);
                        }
                        if(parentTaxonNode != null){
                                if(NavigationUtil.isDirty(parentTaxonNode)){
                        }
                        if(parentTaxonNode != null){
                                if(NavigationUtil.isDirty(parentTaxonNode)){
index 54a28eb90e8da393a1672ef28cd52aa29d2a9c58..93f7108d0c31bf32b3640ca560afa2ca676a67ed 100644 (file)
@@ -62,7 +62,7 @@ public class SelectionDialogFactory {
                        return (T) ClassificationSelectionDialog.select(shell, conversation, (Classification) currentSelection);
                }
                if(clazz.equals(TaxonNode.class)){
                        return (T) ClassificationSelectionDialog.select(shell, conversation, (Classification) currentSelection);
                }
                if(clazz.equals(TaxonNode.class)){
-                       return (T) TaxonNodeSelectionDialog.select(shell, conversation, null, null, (TaxonNode) currentSelection, null);
+                       return (T) TaxonNodeSelectionDialog.select(shell, conversation, null, null, (TaxonNode) currentSelection, ((TaxonNode) currentSelection).getClassification());
                }
                if(clazz.equals(Reference.class)){
                        return (T) ReferenceSelectionDialog.select(shell, conversation, (Reference) currentSelection);
                }
                if(clazz.equals(Reference.class)){
                        return (T) ReferenceSelectionDialog.select(shell, conversation, (Reference) currentSelection);