*/
package eu.etaxonomy.taxeditor.editor.name.handler;
-import org.apache.log4j.Logger;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
import eu.etaxonomy.taxeditor.editor.name.operation.DeleteMisapplicationOperation;
import eu.etaxonomy.taxeditor.editor.name.operation.DeleteSynonymOperation;
-import eu.etaxonomy.taxeditor.editor.view.concept.operation.DeleteConceptRelationOperation;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
/**
* @version 1.0
*/
public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler {
- private static final Logger logger = Logger
- .getLogger(DeleteTaxonBaseHandler.class);
+
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
Object selectedElement = EditorUtil.getSelection(event).getFirstElement();
- AbstractPostOperation operation = null;
- String commandName = null;
-
+ doExecute(event, editor, selectedElement);
+ return null;
+ }
+
+ /**
+ * @param editor
+ * @param selectedElement
+ * @param operation
+ * @param commandName
+ */
+ protected void doExecute(ExecutionEvent event, TaxonNameEditor editor, Object selectedElement) {
+ AbstractPostOperation operation = null;
+ String commandName = null;
+
try {
commandName = event.getCommand().getName();
} catch (NotDefinedException e) {
- logger.error(e);
- throw new RuntimeException(e);
+ EditorUtil.error(getClass(), e);
}
-
// synonym
if(selectedElement instanceof Synonym){
operation = new DeleteSynonymOperation(commandName, editor.getUndoContext(), editor.getTaxon(), (Synonym) selectedElement, editor);
}
EditorUtil.executeOperation(operation);
-
- return null;
}
}