129682681cfd64f27f3ef0048e3abc8ecb2ad264
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor / src / eu / etaxonomy / taxeditor / editor / MenuConstants.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.editor;
11
12 import org.apache.log4j.Logger;
13 import org.eclipse.jface.action.MenuManager;
14 import org.eclipse.jface.action.Separator;
15
16 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
17 import eu.etaxonomy.taxeditor.actions.name.CreateAutonymAction;
18 import eu.etaxonomy.taxeditor.actions.name.CreateConceptRelationAction;
19 import eu.etaxonomy.taxeditor.actions.name.CreateHeterotypicSynonymAction;
20 import eu.etaxonomy.taxeditor.actions.name.CreateMisappliedNameAction;
21 import eu.etaxonomy.taxeditor.actions.name.CreateSynonymInGroupAction;
22 import eu.etaxonomy.taxeditor.actions.name.CreateTaxonomicallyIncludedTaxonAction;
23 import eu.etaxonomy.taxeditor.actions.ui.ChangeTaxonToSynonymAction;
24 import eu.etaxonomy.taxeditor.actions.ui.MoveTaxonDialogAction;
25 import eu.etaxonomy.taxeditor.model.CdmSessionDataRepository;
26
27 /**
28 * @author n.hoffmann
29 * @created 03.02.2009
30 * @version 1.0
31 */
32 public class MenuConstants {
33 private static final Logger logger = Logger.getLogger(MenuConstants.class);
34
35 public static final MenuManager EDITOR_TAXON_MENU(){
36 MenuManager taxonEditorMenu = new MenuManager("Taxon");
37
38 taxonEditorMenu.add(new CreateHeterotypicSynonymAction());
39 taxonEditorMenu.add(new CreateSynonymInGroupAction());
40 taxonEditorMenu.add(new Separator());
41 taxonEditorMenu.add(new CreateMisappliedNameAction());
42
43 // MenuManager subMenu = new MenuManager("Create concept relation");
44 // for (TaxonRelationshipType type :
45 // CdmSessionDataRepository.getDefault().getConceptRelationshipTypes()) {
46 // subMenu.add(new CreateConceptRelationAction(type));
47 // }
48 // taxonEditorMenu.add(subMenu);
49 taxonEditorMenu.add(new Separator());
50 taxonEditorMenu.add(new MoveTaxonDialogAction());
51 taxonEditorMenu.add(new ChangeTaxonToSynonymAction());
52 taxonEditorMenu.add(new Separator());
53 // TODO is it correct that onlx taxa with rank species may have autonyms?
54 // if(taxon.getName().getRank().equals(Rank.SPECIES())){
55 taxonEditorMenu.add(new CreateAutonymAction());
56 // }
57 taxonEditorMenu.add(new CreateTaxonomicallyIncludedTaxonAction());
58
59 return taxonEditorMenu;
60 }
61
62 }