commit 68d759c3c3ac25a9570781117173a420d6583c27
Author: Katja Luther <k.luther@bgbm.org>
Date:   Tue Apr 9 13:33:49 2019 +0200

    ref #8124: remaining issues for name facts (protologue filter)

diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/NameDescriptionFilter.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/NameDescriptionFilter.java
new file mode 100755
index 000000000..fc3a14524
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/NameDescriptionFilter.java
@@ -0,0 +1,57 @@
+/**
+* Copyright (C) 2019 EDIT
+* 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.
+*/
+package eu.etaxonomy.taxeditor.editor.view.descriptive;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+
+/**
+ * @author k.luther
+ * @since 09.04.2019
+ *
+ */
+public class NameDescriptionFilter extends ViewerFilter {
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean select(Viewer viewer, Object parentElement, Object element) {
+        if (element instanceof FeatureNodeContainer ){
+            FeatureNodeContainer desc = (FeatureNodeContainer)element;
+            if(!desc.getFeature().equals(Feature.PROTOLOGUE())){
+                return true;
+            }
+        }
+        if (element instanceof DescriptionBase){
+            for (Object desc:((DescriptionBase) element).getElements()){
+                if (desc instanceof DescriptionElementBase){
+                    if (!((DescriptionElementBase)desc).getFeature().equals(Feature.PROTOLOGUE())){
+                        return true;
+                    }
+                }
+            }
+            if (((DescriptionBase) element).getElements().isEmpty()){
+                return true;
+            }
+        }
+        if (element instanceof DescriptionElementBase){
+            if (!((DescriptionElementBase)element).getFeature().equals(Feature.PROTOLOGUE())){
+                return true;
+            }
+        }
+        return false;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
index 4e31818b0..808248a3d 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
@@ -51,6 +51,7 @@ import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementTransfer
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveLabelProvider;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewerSorter;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.NameDescriptionFilter;
 import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -96,6 +97,7 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
         treeViewer.setContentProvider(provider);
         treeViewer.setLabelProvider(new DescriptiveLabelProvider());
         treeViewer.setSorter(new DescriptiveViewerSorter());
+        treeViewer.setFilters(new NameDescriptionFilter());
         treeViewer.setAutoExpandLevel(2);
         Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };
         treeViewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(
@@ -109,6 +111,7 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
         viewer.addSelectionChangedListener(selectionChangedListener);
         DescriptionElementDropAdapter dropListener = new DescriptionElementDropAdapter(viewer);
         ContextInjectionFactory.inject(dropListener, context);
+
         treeViewer.addDropSupport(dndOperations, transfers,
                 dropListener);
         //create context menu
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DynamicFeatureMenuE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DynamicFeatureMenuE4.java
index e781d57da..d3a892db8 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DynamicFeatureMenuE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DynamicFeatureMenuE4.java
@@ -140,7 +140,9 @@ public class DynamicFeatureMenuE4 {
 			featureTree = TermEditorInput.getDefaultFeatureTree();
 		}
 		if (description instanceof TaxonNameDescription){
-		    featureTree = FeatureTree.NewInstance(CdmStore.getTermManager().getPreferredTerms(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid())));
+		    List<Feature> terms = CdmStore.getTermManager().getPreferredTerms(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid()));
+		    terms.remove(Feature.PROTOLOGUE());
+		    featureTree = FeatureTree.NewInstance(terms);
 		}
 
 		return featureTree;
