private IContributionItem addChildTermsToMenuManager(TermType termType, IServiceLocator serviceLocator) {
- Set<TermType> children = termType.getGeneralizationOf();
- // term type has no children, so create menu item
- if(children.isEmpty()) {
- return createMenuItem(termType, serviceLocator);
+ //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
+ if(children.isEmpty()) {
+ return createMenuItem(termType, serviceLocator);
+ }
+ // 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
+ for(TermType tt : children) {
+ IContributionItem item = addChildTermsToMenuManager(tt,serviceLocator);
+ if(item != null) {
+ dtMenuManager.add(item);
+ }
+ }
+ return dtMenuManager;
+ } else {
+ return null;
}
- // 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
- for(TermType tt : children) {
- IContributionItem item = addChildTermsToMenuManager(tt,serviceLocator);
- if(item != null) {
- dtMenuManager.add(item);
- }
- }
- return dtMenuManager;
}
this.unitType = unitType;
getLayoutComposite().setLayout(LayoutConstants.LAYOUT(2, false));
- text_minVal = formFactory.createNumberTextWithLabelElement(this,
- "Min : ", getMinimum(), style);
-
- text_maxVal = formFactory.createNumberTextWithLabelElement(this,
- "Max : ", getMaximum(), style);
-
+ switch(unitType) {
+ case ELEVATION:
+ text_minVal = formFactory.createNumberTextWithLabelElement(this, "Min [m] : ", getMinimum(), style);
+ text_maxVal = formFactory.createNumberTextWithLabelElement(this, "Max [m] : ", getMaximum(), style);
+ break;
+ default:
+ text_minVal = formFactory.createNumberTextWithLabelElement(this, "Min [m] : ", getMinimum(), style);
+ text_maxVal = formFactory.createNumberTextWithLabelElement(this, "Max [m] : ", getMaximum(), style);
+ break;
+ }
text_freeText = formFactory.createTextWithLabelElement(this,
"Freetext : ", getFreetext(), style);
+
formFactory.addPropertyChangeListener(this);
}