- added TaxonDeletionConfigurator to delete operations
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / name / operation / DeleteTaxonBaseOperation.java
index 4f8472074f3b34aad9c99e5e0a10dc096a93fc0c..c65dda535e5f559e04d9da813723b6cab3b6d58f 100644 (file)
@@ -5,31 +5,23 @@ import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;\r
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.IStatus;\r
-import org.eclipse.ui.IEditorInput;\r
-import org.eclipse.ui.IEditorReference;\r
-import org.eclipse.ui.IPerspectiveDescriptor;\r
-import org.eclipse.ui.IViewPart;\r
 import org.eclipse.ui.IWorkbenchPage;\r
-import org.eclipse.ui.PartInitException;\r
 \r
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
-import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;\r
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 \r
 public class DeleteTaxonBaseOperation extends AbstractPersistentPostOperation {\r
-       \r
-       private IWorkbenchPage activePage;\r
-       \r
+\r
+       protected TaxonDeletionConfigurator configurator;\r
+\r
        public DeleteTaxonBaseOperation(String label, IUndoContext undoContext,\r
-                       Taxon taxon, IWorkbenchPage activePage, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {\r
+               TaxonDeletionConfigurator configurator, IWorkbenchPage activePage, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {\r
                super(label, undoContext, postOperationEnabled,\r
                                 conversationEnabled);\r
-               this.activePage = activePage;\r
-               \r
+               this.configurator = configurator;\r
+\r
        }\r
 \r
        @Override\r
@@ -52,25 +44,4 @@ public class DeleteTaxonBaseOperation extends AbstractPersistentPostOperation {
                // TODO Auto-generated method stub\r
                return null;\r
        }\r
-       \r
-       protected void closeObsoleteEditor(Taxon taxon){\r
-               for (IEditorReference ref : activePage.getEditorReferences()) {\r
-                       \r
-                       IViewPart view =  activePage.findView("eu.etaxonomy.taxeditor.navigation.navigator");\r
-               \r
-                       try {\r
-                               IEditorInput input = ref.getEditorInput(); \r
-                               if (input instanceof TaxonEditorInput) {\r
-                                       TaxonNode node = ((TaxonEditorInput) input).getTaxonNode();\r
-                                       if (taxonNode.equals(node)) {\r
-                                               activePage.closeEditor(ref.getEditor(false), false);\r
-                                       }\r
-                               }\r
-                       } catch (PartInitException e) {\r
-                               continue;\r
-                       }\r
-               }\r
-       }\r
 }\r
-\r
-\r