3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.actions
.images
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.eclipse
.core
.commands
.operations
.IUndoableOperation
;
17 import org
.eclipse
.jface
.action
.Action
;
18 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
20 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
21 import eu
.etaxonomy
.taxeditor
.ITaxEditorConstants
;
22 import eu
.etaxonomy
.taxeditor
.TaxEditorPlugin
;
23 import eu
.etaxonomy
.taxeditor
.controller
.EditorController
;
24 import eu
.etaxonomy
.taxeditor
.controller
.GlobalController
;
25 import eu
.etaxonomy
.taxeditor
.operations
.images
.RemoveImageOperation
;
32 public class RemoveImageAction
extends Action
{
33 private static final Logger logger
= Logger
34 .getLogger(RemoveImageAction
.class);
36 private static final String text
= "Remove image from taxon"; //$NON-NLS-1$
37 private static final ImageDescriptor image
= TaxEditorPlugin
.getDefault()
38 .getImageDescriptor(ITaxEditorConstants
.ACTIVE_DELETE_ICON
);
46 private RemoveImageAction() {
54 public RemoveImageAction(Taxon taxon
, URL url
) {
62 IUndoableOperation operation
= new RemoveImageOperation
63 (this.getText(), EditorController
.getUndoContext(taxon
), taxon
, url
);
65 GlobalController
.executeOperation(operation
);