p2izing the editor
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor / src / eu / etaxonomy / taxeditor / actions / cdm / DeleteTaxonAction.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.taxeditor.actions.cdm;
11
12 /**
13 * @author p.ciardelli
14 * @created 14.05.2008
15 * @version 1.0
16 */
17 import org.apache.log4j.Logger;
18 import org.eclipse.core.commands.ExecutionException;
19 import org.eclipse.core.commands.operations.IOperationHistory;
20 import org.eclipse.core.commands.operations.IUndoContext;
21 import org.eclipse.core.commands.operations.IUndoableOperation;
22 import org.eclipse.core.runtime.IProgressMonitor;
23 import org.eclipse.core.runtime.IStatus;
24 import org.eclipse.jface.action.Action;
25 import org.eclipse.jface.resource.ImageDescriptor;
26
27 import eu.etaxonomy.cdm.model.taxon.Taxon;
28 import eu.etaxonomy.taxeditor.ITaxEditorConstants;
29 import eu.etaxonomy.taxeditor.TaxEditorPlugin;
30 import eu.etaxonomy.taxeditor.controller.GlobalController;
31 import eu.etaxonomy.taxeditor.operations.DeleteTaxonOperation;
32
33 /**
34 * Delete this taxon from the CDM
35 *
36 * @author p.ciardelli
37 *
38 * @deprecated
39 */
40 public class DeleteTaxonAction extends Action {
41 private static final Logger logger = Logger
42 .getLogger(DeleteTaxonAction.class);
43
44 private static String text = "Delete taxon from tree";
45 private ImageDescriptor image = TaxEditorPlugin.getDefault()
46 .getImageDescriptor(ITaxEditorConstants.ACTIVE_DELETE_ICON);
47
48 private IUndoContext undoContext;
49
50 Taxon taxon;
51
52 public DeleteTaxonAction() {
53 super(text);
54 setImageDescriptor(image);
55
56 undoContext = GlobalController.getWorkbenchUndoContext();
57 }
58
59 @Deprecated
60 public DeleteTaxonAction(Taxon taxon) {
61 this();
62
63 this.taxon = taxon;
64 }
65
66 @Deprecated
67 public void run() {
68 IUndoableOperation operation = new DeleteTaxonOperation
69 (this.getText(), undoContext, taxon);
70
71 GlobalController.executeOperation(operation);
72 }
73 }