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.
9 package eu
.etaxonomy
.taxeditor
.editor
.name
;
11 import org
.apache
.log4j
.Logger
;
12 import org
.eclipse
.swt
.graphics
.Font
;
13 import org
.eclipse
.swt
.widgets
.Composite
;
14 import org
.eclipse
.ui
.forms
.IManagedForm
;
15 import org
.eclipse
.ui
.views
.properties
.IPropertySource
;
17 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
18 import eu
.etaxonomy
.taxeditor
.actions
.ui
.ChangeTaxonToSynonymAction
;
19 import eu
.etaxonomy
.taxeditor
.actions
.ui
.MoveTaxonDialogAction
;
20 import eu
.etaxonomy
.taxeditor
.editor
.ContextMenu
;
27 public class AcceptedNameComposite
extends NameComposite
{
28 @SuppressWarnings("unused")
29 private static final Logger logger
= Logger
30 .getLogger(AcceptedNameComposite
.class);
32 public AcceptedNameComposite(Composite groupComposite
, IManagedForm form
,
34 super(groupComposite
, form
, NameComposite
.ACCEPTED_TAXON
, taxon
);
37 setIcon(ACCEPTED_ICON
);
38 setFont(getViewerFont());
39 setIndent(ACCEPTED_INDENT
);
43 initNameViewer(taxon
);
46 private void createMenu() {
47 ContextMenu contextMenu
= createContextMenu();
49 contextMenu
.addAction(new ChangeTaxonToSynonymAction(getTaxon()));
50 contextMenu
.addAction(new MoveTaxonDialogAction(getTaxon()));
52 // TODO Make action "Create autonym and subspecies"
53 // contextMenu.addSeparator();
55 // contextMenu.addAction(new CreateAutonym(getTaxon()));
56 // contextMenu.addAction(new CreateSubspecies(getTaxon()));
60 public IPropertySource
getPropertySource() {
61 if (getTaxon() == null) {
64 return getPropertySourceByName(getTaxon().getName());
68 protected Font
getViewerFont() {