+/**
+* 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;
+ }
+
+}