commit 663a45e5cb645eb10b65d7105bca8b3f3a7cb825
Author: Katja Luther <k.luther@bgbm.org>
Date:   Mon Feb 4 13:55:02 2019 +0100

    ref #7854: fix filter for none status and adapt filter to status display preference

diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterRowConfiguration.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterRowConfiguration.java
index 9caba5529..3f1092305 100755
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterRowConfiguration.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterRowConfiguration.java
@@ -104,7 +104,7 @@ public class FilterRowConfiguration extends AbstractRegistryConfiguration {
 
             configRegistry.registerConfigAttribute(
                     FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
-                    new StatusDisplayConverter(),
+                    new FilterStatusDisplayConverter(),
                     DisplayMode.NORMAL,
                     FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX+i);
 
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterStatusDisplayConverter.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterStatusDisplayConverter.java
index 1ff61a1b8..c6230fc28 100755
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterStatusDisplayConverter.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/FilterStatusDisplayConverter.java
@@ -8,11 +8,15 @@
 */
 package eu.etaxonomy.taxeditor.editor.view.checklist.e4;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
 
 import eu.etaxonomy.cdm.model.common.Representation;
 import eu.etaxonomy.cdm.model.description.Distribution;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
+import eu.etaxonomy.cdm.model.metadata.TermDisplayEnum;
+import eu.etaxonomy.taxeditor.preference.EditorPreferencePredicate;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -21,7 +25,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  */
 public class FilterStatusDisplayConverter extends DisplayConverter{
-    public static final String DEFAULT_ENTRY = "";
+    public static final String DEFAULT_ENTRY = " ";
     /**
      * {@inheritDoc}
      */
@@ -32,18 +36,48 @@ public class FilterStatusDisplayConverter extends DisplayConverter{
             if (distribution.getStatus() != null){
 
                 Representation rep = distribution.getStatus().getPreferredRepresentation(CdmStore.getDefaultLanguage());
+                String displayStatus = PreferencesUtil.getStringValue(EditorPreferencePredicate.DisplayOfStatus.getKey());
                 String label = rep.getLabel();
-                return (label != null)?label:DEFAULT_ENTRY;
+                if(PreferencesUtil.displayStatusInChecklistEditor().equals(TermDisplayEnum.IdInVocabulary.getKey())){
+                    return (StringUtils.isNotBlank(distribution.getStatus().getIdInVocabulary()))?distribution.getStatus().getIdInVocabulary():label;
+                }else if(PreferencesUtil.displayStatusInChecklistEditor().equals(TermDisplayEnum.Symbol1.getKey())){
+
+                    return (StringUtils.isNotBlank(distribution.getStatus().getSymbol() ))?distribution.getStatus().getSymbol():label;
+                }else if(PreferencesUtil.displayStatusInChecklistEditor().equals(TermDisplayEnum.Symbol2.getKey())){
+                    return (StringUtils.isNotBlank(distribution.getStatus().getSymbol2() ))?distribution.getStatus().getSymbol2():label;
+                }else{
+                    return (label != null)?label:DEFAULT_ENTRY;
+                }
+
+
 
             }
 
             return "";
         }else if(canonicalValue instanceof PresenceAbsenceTerm){
-            return ((PresenceAbsenceTerm)canonicalValue).getLabel();
+            PresenceAbsenceTerm status = (PresenceAbsenceTerm)canonicalValue;
+            Representation rep = status.getPreferredRepresentation(CdmStore.getDefaultLanguage());
+            String displayStatus = PreferencesUtil.getStringValue(EditorPreferencePredicate.DisplayOfStatus.getKey());
+            String label = rep.getLabel();
+            if (status.getId() == 0){
+                return DEFAULT_ENTRY;
+            }
+            if(PreferencesUtil.displayStatusInChecklistEditor().equals(TermDisplayEnum.IdInVocabulary.getKey())){
+                return (StringUtils.isNotBlank(status.getIdInVocabulary()))?status.getIdInVocabulary():label;
+            }else if(PreferencesUtil.displayStatusInChecklistEditor().equals(TermDisplayEnum.Symbol1.getKey())){
+
+                return (StringUtils.isNotBlank(status.getSymbol() ))?status.getSymbol():label;
+            }else if(PreferencesUtil.displayStatusInChecklistEditor().equals(TermDisplayEnum.Symbol2.getKey())){
+                return (StringUtils.isNotBlank(status.getSymbol2() ))?status.getSymbol2():label;
+            }else{
+                return (label != null)?label:DEFAULT_ENTRY;
+            }
+
+
         } else if(canonicalValue!=null){
             return canonicalValue.toString();
         }
-        return null;
+        return DEFAULT_ENTRY;
     }
 
     /**
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/StatusDisplayConverter.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/StatusDisplayConverter.java
index cbec7c13f..3671d2f12 100755
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/StatusDisplayConverter.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/StatusDisplayConverter.java
@@ -24,7 +24,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  */
 public class StatusDisplayConverter extends DisplayConverter{
-    public static final String DEFAULT_ENTRY = "";
+    public static final String DEFAULT_ENTRY = " ";
     /**
      * {@inheritDoc}
      */
@@ -57,7 +57,7 @@ public class StatusDisplayConverter extends DisplayConverter{
                 }
             }
 
-            return "";
+            return DEFAULT_ENTRY;
         }else if(canonicalValue instanceof PresenceAbsenceTerm){
             return ((PresenceAbsenceTerm)canonicalValue).getLabel();
         } else if(canonicalValue!=null){
