9307c158197ee5943cc66f3e6926fd8d3f579869
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.actions
.ui
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.eclipse
.jface
.action
.Action
;
14 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
15 import org
.eclipse
.ui
.IWorkbenchWindow
;
16 import org
.eclipse
.ui
.actions
.ActionFactory
;
18 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
19 import eu
.etaxonomy
.taxeditor
.ITaxEditorConstants
;
20 import eu
.etaxonomy
.taxeditor
.TaxEditorPlugin
;
21 import eu
.etaxonomy
.taxeditor
.controller
.EditorController
;
24 * Opens a taxon editor for an existing taxon.
26 * FIXME this action is broken and actually throws lots of hibernate exceptions
33 public class OpenTaxonEditorAction
extends Action
implements ActionFactory
.IWorkbenchAction
{
34 private static final Logger logger
= Logger
35 .getLogger(OpenTaxonEditorAction
.class);
37 private static String editTaxonText
= "Edit taxon";
38 private static String newTaxonText
= "Add new taxon";
39 private ImageDescriptor image
= TaxEditorPlugin
.getDefault()
40 .getImageDescriptor(ITaxEditorConstants
.OPEN_TAXON_ICON
);
42 private IWorkbenchWindow window
;
45 public static final String ID
= "eu.etaxonomy.taxeditor.actions.opennameeditoraction"; //$NON-NLS-1$
48 public OpenTaxonEditorAction(Taxon taxon
) {
53 setText(editTaxonText
);
58 public OpenTaxonEditorAction() {
60 setImageDescriptor(image
);
67 EditorController
.open(taxon
);
69 // For clients who re-use the same instance of this class,
70 // taxon is re-initalized to ensure a new Taxon is opened every time
75 public void dispose() {