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
.jface
.action
.Action
;
13 import org
.eclipse
.swt
.graphics
.Font
;
14 import org
.eclipse
.swt
.widgets
.Composite
;
15 import org
.eclipse
.ui
.forms
.IManagedForm
;
16 import org
.eclipse
.ui
.views
.properties
.IPropertySource
;
18 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
19 import eu
.etaxonomy
.taxeditor
.actions
.ui
.ChangeTaxonToSynonymAction
;
20 import eu
.etaxonomy
.taxeditor
.actions
.ui
.MoveTaxonDialogAction
;
21 import eu
.etaxonomy
.taxeditor
.editor
.ContextMenu
;
28 public class AcceptedNameComposite
extends NameComposite
{
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 // TODO Make action "Create autonym and subspecies"
51 Action changeTaxonAction
= new ChangeTaxonToSynonymAction(getTaxon());
52 contextMenu
.addAction(changeTaxonAction
);
54 Action moveTaxonAction
= new MoveTaxonDialogAction(getTaxon());
55 contextMenu
.addAction(moveTaxonAction
);
59 public IPropertySource
getPropertySource() {
60 if (getTaxon() == null) {
63 return getPropertySourceByName(getTaxon().getName());
67 protected Font
getViewerFont() {