AT: committing changes to the TaxEditor to fix issues with the dynamic menu building
authora.theys <a.theys@localhost>
Wed, 27 Jun 2012 16:33:27 +0000 (16:33 +0000)
committera.theys <a.theys@localhost>
Wed, 27 Jun 2012 16:33:27 +0000 (16:33 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java

index d51bbfe14dfa511135873d2162f9d7d850aff746..766c5cf8dfc0ab60daf4f42c4364afb0be16f5a2 100644 (file)
@@ -78,14 +78,9 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                                        if (selectedElement instanceof TaxonDescription) {
                                                FeatureTree featureTree = getFeatureTree((TaxonDescription) selectedElement);
 
-                                               for (FeatureNode childNode : featureTree
-                                                               .getRootChildren()) {
-                                                       if (!(childNode.getFeature().getUuid()
-                                                                       .equals(UsageTermCollection.uuidUseRecordFeature))
-                                                                       && !(childNode.getFeature().getUuid()
-                                                                                       .equals(UsageTermCollection.uuidUseSummaryFeature))) {
-                                                               createMenuItem(menu, childNode.getFeature());
-                                                       }
+                                               for (FeatureNode childNode : featureTree.getRootChildren()) {
+                                                       createMenuItem(menu, childNode.getFeature());
+
                                                }
                                        } else if (selectedElement instanceof FeatureNodeContainer) {
                                                FeatureNode featureNode = ((FeatureNodeContainer) selectedElement)
@@ -112,26 +107,25 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                MenuItem menuItem = new MenuItem(menu, -1);
                final Feature deproxiedFeature = (Feature) HibernateProxyHelper
                                .deproxy(feature);
-               
 
-                       menuItem.setText(deproxiedFeature.getLabel());
-                       menuItem.addSelectionListener(new SelectionListener() {
+               menuItem.setText(deproxiedFeature.getLabel());
+               menuItem.addSelectionListener(new SelectionListener() {
 
-                               public void widgetDefaultSelected(SelectionEvent e) {
-                               }
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                       }
 
-                               public void widgetSelected(SelectionEvent ev) {
-                                       Event event = new Event();
-                                       event.data = deproxiedFeature;
-                                       try {
-                                               handlerService.executeCommand(
-                                                               CreateDescriptionElementOperation.ID, event);
-                                       } catch (Exception e) {
-                                               EditorUtil.error(getClass(), e);
-                                       }
+                       public void widgetSelected(SelectionEvent ev) {
+                               Event event = new Event();
+                               event.data = deproxiedFeature;
+                               try {
+                                       handlerService.executeCommand(
+                                                       CreateDescriptionElementOperation.ID, event);
+                               } catch (Exception e) {
+                                       EditorUtil.error(getClass(), e);
                                }
-                       });
-               
+                       }
+               });
+
        }
 
        /**