import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* Menu used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
@Override
protected IContributionItem[] getContributionItems() {
Collection<IContributionItem> items = new ArrayList<IContributionItem>();
- MenuManager dtMenuManager =
- new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu");
-
- dtMenuManager.setVisible(true);
-
- items.add(dtMenuManager);
- //add Feature and NamedArea to top level
- dtMenuManager.add(addChildTermsToMenuManager(TermType.Feature));
- dtMenuManager.add(addChildTermsToMenuManager(TermType.NamedArea));
- dtMenuManager.add(new Separator());
-
- MenuManager otherMenuManager =
- new MenuManager("Others","eu.etaxonomy.taxeditor.store.term.other.menu");
- otherMenuManager.setVisible(true);
- dtMenuManager.add(otherMenuManager);
-
- List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
- Collections.sort(ttList,new SortByTermTypeMessage());
- for (TermType tt : ttList)
- {
- //skip Feature and NamedArea as they have already been added to top level
- if(tt.equals(TermType.Feature) || tt.equals(TermType.NamedArea)){
- continue;
- }
- // 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);
- if(ici != null) {
- otherMenuManager.add(ici);
- }
- }
- }
+ if(CdmStore.isActive()){
+ MenuManager dtMenuManager =
+ new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu");
+
+ dtMenuManager.setVisible(true);
+
+ items.add(dtMenuManager);
+ //add Feature and NamedArea to top level
+ dtMenuManager.add(addChildTermsToMenuManager(TermType.Feature));
+ dtMenuManager.add(addChildTermsToMenuManager(TermType.NamedArea));
+ dtMenuManager.add(new Separator());
+
+ MenuManager otherMenuManager =
+ new MenuManager("Others","eu.etaxonomy.taxeditor.store.term.other.menu");
+ otherMenuManager.setVisible(true);
+ dtMenuManager.add(otherMenuManager);
+
+ List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
+ Collections.sort(ttList,new SortByTermTypeMessage());
+ for (TermType tt : ttList)
+ {
+ //skip Feature and NamedArea as they have already been added to top level
+ if(tt.equals(TermType.Feature) || tt.equals(TermType.NamedArea)){
+ continue;
+ }
+ // 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);
+ if(ici != null) {
+ otherMenuManager.add(ici);
+ }
+ }
+ }
+ }
return items.toArray(new IContributionItem[]{});
}