fix #5800: remove taxonomically included from menu
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / concept / handler / AbstractDynamicConceptRelationMenu.java
index 2d63caf0d0595aef43023d3c03a268c77ccc9da9..228705c8648acc0bd2569ec1e6525861a402f6d4 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.editor.view.concept.handler;
 
@@ -14,7 +14,6 @@ import org.eclipse.ui.handlers.IHandlerService;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -25,7 +24,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  */
 public abstract class AbstractDynamicConceptRelationMenu extends ContributionItem {
-       
+
        /*
         * (non-Javadoc)
         * @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Menu, int)
@@ -51,18 +50,21 @@ public abstract class AbstractDynamicConceptRelationMenu extends ContributionIte
                                        } catch (Exception e) {
                                                EditorUtil.error(getClass(), "Error executing command", e);
                                        }
-                               }                               
+                               }
                        });
                */
                for(final TaxonRelationshipType taxonRelationshipType: CdmStore.getTermManager().getPreferredTerms(TaxonRelationshipType.class)){
+                   if (!taxonRelationshipType.equals(TaxonRelationshipType.TAXONOMICALLY_INCLUDED_IN())){
                        MenuItem menuItem = new MenuItem(menu, -1);
                        menuItem.setText(taxonRelationshipType.getTitleCache());
                        menuItem.setData(taxonRelationshipType);
                        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 = taxonRelationshipType;
                                        try {
@@ -70,11 +72,12 @@ public abstract class AbstractDynamicConceptRelationMenu extends ContributionIte
                                        } catch (Exception e) {
                                                MessagingUtils.error(getClass(), "Error executing command", e);
                                        }
-                               }                               
+                               }
                        });
+                   }
                }
        }
-       
+
        /**
         * <p>getCommandName</p>
         *