(no commit message)
[taxeditor.git] / taxeditor-navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / handler / MoveTaxonHandler.java
index a9a4a4666da6d54e11119762f12af3ff860ca83b..3fa802a5c50c8fafa8aa7a21a785b539928fd588 100644 (file)
@@ -20,11 +20,13 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoableOperation;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PartInitException;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.dialogs.filteredSelection.FilteredTaxonNodeSelectionDialog;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.operations.MoveTaxonOperation;
 
@@ -42,6 +44,14 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        public Object execute(ExecutionEvent event) throws ExecutionException {
+               TaxonNavigator taxonNavigator;
+               try {
+                       taxonNavigator = (TaxonNavigator) NavigationUtil.getView(TaxonNavigator.ID);
+               } catch (PartInitException e) {
+                       logger.error(e);
+                       throw new RuntimeException(e);
+               }
+               
                Shell shell = NavigationUtil.getShell();
                TaxonNode taxonNode = (TaxonNode) NavigationUtil.getCurrentSelection(event);
                
@@ -63,7 +73,7 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
                        
                        IUndoableOperation operation = new MoveTaxonOperation
                                        ("Move taxon to new parent", NavigationUtil.getUndoContext(), 
-                                                               taxonNode, parentTaxonNode, this); //$NON-NLS-1$
+                                                               taxonNode, parentTaxonNode, this, taxonNavigator); //$NON-NLS-1$
                        NavigationUtil.executeOperation(operation);
                
                }