* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
/**
* Menu factory used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
* for term types which when clicked open the defined term editor for the chosen term type
/**
* Menu factory used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
* for term types which when clicked open the defined term editor for the chosen term type
- IContributionRoot additions) {
-
- MenuManager dtMenuManager =
- new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu");
-
- dtMenuManager.setVisible(true);
-
- additions.addContributionItem(dtMenuManager, null);
- List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
- Collections.sort(ttList,new SortByTermTypeMessage());
- for (TermType tt : ttList)
- {
- // if term type has a parent, do not add it
- // it will be added in the recursive call
- if(tt.getKindOf() == null) {
- IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);
- if(ici != null) {
- dtMenuManager.add(ici);
- }
- }
- }
+ IContributionRoot additions) {
+ MenuManager dtMenuManager =
+ new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu");
+
+ dtMenuManager.setVisible(true);
+
+ additions.addContributionItem(dtMenuManager, null);
+ List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
+ Collections.sort(ttList,new SortByTermTypeMessage());
+ for (TermType tt : ttList)
+ {
+ // if term type has a parent, do not add it
+ // it will be added in the recursive call
+ if(tt.getKindOf() == null) {
+ IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);
+ if(ici != null) {
+ dtMenuManager.add(ici);
+ }
+ }
+ }
//FIXME : need a better way to find out if a term type can be editable (ticket 3853)
if(termType.getEmptyDefinedTermBase() != null) {
Set<TermType> children = termType.getGeneralizationOf();
// term type has no children, so create menu item
//FIXME : need a better way to find out if a term type can be editable (ticket 3853)
if(termType.getEmptyDefinedTermBase() != null) {
Set<TermType> children = termType.getGeneralizationOf();
// term type has no children, so create menu item
- // term type has children, so create sub menu
- MenuManager dtMenuManager =
- new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu");
+ // term type has children, so create sub menu
+ MenuManager dtMenuManager =
+ new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu");
dtMenuManager.setVisible(true);
dtMenuManager.add(createDefaultMenuItem(termType, serviceLocator));
Separator sep = new Separator();
dtMenuManager.add(sep);
// add child items to the sub menu
dtMenuManager.setVisible(true);
dtMenuManager.add(createDefaultMenuItem(termType, serviceLocator));
Separator sep = new Separator();
dtMenuManager.add(sep);
// add child items to the sub menu
Map<String, String> params = new HashMap<String, String>();
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
Map<String, String> params = new HashMap<String, String>();
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
Map<String, String> params = new HashMap<String, String>();
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
Map<String, String> params = new HashMap<String, String>();
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",