Revision 7bfcd973
Added by Patrick Plitzner over 9 years ago
- added option for deep delete (with children) to DerivateEditor
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/DeleteDerivateHandler.java | ||
---|---|---|
69 | 69 |
label += " "+DerivateLabelProvider.getDerivateText(value, conversationHolder); |
70 | 70 |
} |
71 | 71 |
SpecimenDeleteConfigurator config = new SpecimenDeleteConfigurator(); |
72 |
config.setDeleteChildren(false); |
|
72 |
boolean deepDelete = event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivate.deepDelete"); |
|
73 |
config.setDeleteChildren(deepDelete); |
|
74 |
config.setDeleteMolecularData(deepDelete); |
|
73 | 75 |
DeleteDerivateOperation deleteDerivateOperation = new DeleteDerivateOperation(label, undoContext, (CdmBase) value, postOperationEnabled, config); |
74 | 76 |
AbstractUtility.executeOperation(deleteDerivateOperation); |
75 | 77 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/DeleteDerivateOperation.java | ||
---|---|---|
60 | 60 |
@Override |
61 | 61 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { |
62 | 62 |
if(getPostOperationEnabled() instanceof ISaveablePart){ |
63 |
if(!MessagingUtils.confirmDialog("Confirm deletion", "Do you really want to delete the selected element?")){ |
|
63 |
String confirmationQuestion = "Do you really want to delete the selected element"; |
|
64 |
if(deleteConfigurator.isDeleteChildren()){ |
|
65 |
confirmationQuestion += " and its children"; |
|
66 |
} |
|
67 |
confirmationQuestion += "?"; |
|
68 |
if(!MessagingUtils.confirmDialog("Confirm deletion", confirmationQuestion)){ |
|
64 | 69 |
return Status.CANCEL_STATUS; |
65 | 70 |
} |
66 | 71 |
if(((ISaveablePart) getPostOperationEnabled()).isDirty()){ |
Also available in: Unified diff