merged/implemented cdm3.3 model adaptations
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / descriptive / handler / DynamicFeatureMenu.java
index 766c5cf8dfc0ab60daf4f42c4364afb0be16f5a2..0c10b9ad7df145bd2f37f166c3d583d5a79120d6 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * 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.
  */
@@ -31,7 +31,6 @@ import eu.etaxonomy.cdm.model.description.FeatureNode;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -42,7 +41,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * <p>
  * DynamicFeatureMenu class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created 17.04.2009
  * @version 1.0
@@ -56,7 +55,7 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
         */
@@ -65,7 +64,8 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
        protected IContributionItem[] getContributionItems() {
 
                return new IContributionItem[] { new ContributionItem() {
-                       public void fill(Menu menu, int index) {
+                       @Override
+            public void fill(Menu menu, int index) {
 
                                ISelection selection = selectionService
                                                .getSelection(DescriptiveViewPart.ID);
@@ -90,7 +90,7 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                                                createMenuItem(menu, featureNode.getFeature());
 
                                                // add possible children to the menu
-                                               for (FeatureNode childNode : featureNode.getChildren()) {
+                                               for (FeatureNode childNode : featureNode.getChildNodes()) {
                                                        createMenuItem(menu, childNode.getFeature());
                                                }
                                        } else if (selectedElement instanceof DescriptionElementBase) {
@@ -111,10 +111,12 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                menuItem.setText(deproxiedFeature.getLabel());
                menuItem.addSelectionListener(new SelectionListener() {
 
-                       public void widgetDefaultSelected(SelectionEvent e) {
+                       @Override
+            public void widgetDefaultSelected(SelectionEvent e) {
                        }
 
-                       public void widgetSelected(SelectionEvent ev) {
+                       @Override
+            public void widgetSelected(SelectionEvent ev) {
                                Event event = new Event();
                                event.data = deproxiedFeature;
                                try {
@@ -130,10 +132,10 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
 
        /**
         * Retrieves the feature tree associated with the given description
-        * 
+        *
         * TODO as of now this is always the same thing because feature trees may
         * not be associated to descriptions yet.
-        * 
+        *
         * @param description
         * @return
         */