Merge branch 'develop' into remoting-4.0
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / navigator / handler / DeleteHandler.java
index 5a8650098b30cf91fe380d90fb7f994e7be7fc87..2f71b0aee3c47b88adc98f395bd25d2a585693ca 100644 (file)
@@ -34,7 +34,6 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
@@ -64,6 +63,12 @@ public class DeleteHandler extends AbstractHandler{
 
                TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
 
+
+               String plural = selection.size() > 1 ? "s" : "";
+               // Prompt user for confirmation
+
+
+
                Iterator selectionIterator = selection.iterator();
                Set<ITaxonTreeNode> treeNodes = new HashSet<ITaxonTreeNode>();
 
@@ -134,11 +139,17 @@ public class DeleteHandler extends AbstractHandler{
                                        /*if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected nodes?")){
                                                return null;
                                        }*/
-                                               operation = new DeleteOperation(
-                                                               event.getCommand().getName(), NavigationUtil.getUndoContext(),
-                                                               taxonNode, config, taxonNavigator, taxonNavigator);
 
-                                               AbstractUtility.executeOperation(operation);
+                                               operation = new DeleteOperation(event.getCommand().getName(),
+                                                       NavigationUtil.getUndoContext(),
+                                                               taxonNode,
+                                                               config,
+                                                               taxonNavigator,
+                                                               taxonNavigator,
+                                                               taxonNavigator);
+
+                                               NavigationUtil.executeOperation(operation);
+
                                                //}
                                }
 
@@ -153,11 +164,17 @@ public class DeleteHandler extends AbstractHandler{
                                        return null;
                                }
                                if (allEditorsClosed){
-                                       operation = new DeleteOperation(
-                                                       event.getCommand().getName(), NavigationUtil.getUndoContext(),
-                                                       treeNodes, new TaxonDeletionConfigurator(), taxonNavigator, taxonNavigator);
 
-                                       AbstractUtility.executeOperation(operation);
+                                       operation = new DeleteOperation(event.getCommand().getName(),
+                                               NavigationUtil.getUndoContext(),
+                                                       treeNodes,
+                                                       new TaxonDeletionConfigurator(),
+                                                       taxonNavigator,
+                                                       taxonNavigator,
+                                                       taxonNavigator);
+
+                                       NavigationUtil.executeOperation(operation);
+
                                }
                        }catch (NotDefinedException e) {
                                MessagingUtils.warn(getClass(), "Command name not set");