- added TaxonDeletionConfigurator to delete operations
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / name / operation / DeleteTaxonOperation.java
index 98626f5d855ebf7f4318faf18a6eb41a9941d3ae..e7cd64a7ec18092c53e40af40a99353d30a04200 100644 (file)
@@ -23,15 +23,12 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
 public class DeleteTaxonOperation extends DeleteTaxonBaseOperation{\r
-       //private Taxon taxon;\r
-       private final Classification classification;\r
-\r
-\r
 \r
+    private final Classification classification;\r
 \r
        public DeleteTaxonOperation(String label, IUndoContext undoContext,\r
-                       Taxon taxon, Classification classification, IWorkbenchPage activePage, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {\r
-               super(label, undoContext, taxon, activePage, postOperationEnabled, conversationEnabled);\r
+                       Taxon taxon, TaxonDeletionConfigurator configurator, Classification classification, IWorkbenchPage activePage, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {\r
+               super(label, undoContext, configurator, activePage, postOperationEnabled, conversationEnabled);\r
                this.element = taxon;\r
 \r
                Set<TaxonNode> nodes = taxon.getTaxonNodes();\r
@@ -52,8 +49,6 @@ public class DeleteTaxonOperation extends DeleteTaxonBaseOperation{
 \r
        }\r
 \r
-\r
-\r
        @Override\r
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
@@ -64,17 +59,16 @@ public class DeleteTaxonOperation extends DeleteTaxonBaseOperation{
 \r
                                ICdmApplicationConfiguration controller;\r
 \r
-                               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();\r
+                               controller = CdmStore.getCurrentApplicationConfiguration();\r
 \r
                                ITaxonService service = controller.getTaxonService();\r
-                               \r
 \r
-                               DeleteResult result =   service.deleteTaxon(element, new TaxonDeletionConfigurator(), classification);\r
+\r
+                               DeleteResult result =   service.deleteTaxon(element, configurator, classification);\r
                                if (result.isError()){\r
                                        MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage());\r
                                }\r
 \r
-                               //closeObsoleteEditor(taxon);\r
                                monitor.worked(40);\r
 \r
 \r
@@ -95,5 +89,4 @@ public class DeleteTaxonOperation extends DeleteTaxonBaseOperation{
                return null;\r
        }\r
 \r
-\r
-}\r
+}
\ No newline at end of file