- if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
- return null;
+ if (taxonNode.hasChildNodes()){
+ MessageDialog dialog = new MessageDialog(HandlerUtil.getActiveShell(event), "Confirm Deletion", null,
+ "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();
+
+ if (result == 0){
+ //delete all children
+ configNodes.setChildHandling(ChildHandling.DELETE);
+ config.setTaxonNodeConfig(configNodes);
+ } else if (result == 1){
+ //move children
+ configNodes.setChildHandling(ChildHandling.MOVE_TO_PARENT);
+ config.setTaxonNodeConfig(configNodes);
+ } else if (result == 2){
+ //skip
+ return null;
+
+ }
+ }else{
+ if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
+ return null;
+ }