diff --git a/src/main/java/org/humanistika/oxygen/tei/completer/TeiCompleter.java b/src/main/java/org/humanistika/oxygen/tei/completer/TeiCompleter.java index 7662f37..0c6c6cc 100755 --- a/src/main/java/org/humanistika/oxygen/tei/completer/TeiCompleter.java +++ b/src/main/java/org/humanistika/oxygen/tei/completer/TeiCompleter.java @@ -55,6 +55,7 @@ import java.awt.*; import java.util.List; +import java.util.stream.Collectors; /** * TEI-Completer @@ -90,12 +91,19 @@ public String getDescription() { public List filterAttributeValues(final List list, final WhatPossibleValuesHasAttributeContext context) { if (context != null) { final AutoCompleteSuggestions autoCompleteSuggestions = getAutoCompleteSuggestions(context); + if(autoCompleteSuggestions != null) { - list.addAll(autoCompleteSuggestions.getSuggestions()); + List spacePrefixedList = autoCompleteSuggestions.getSuggestions().stream().map(ciValue -> { + ciValue.setValue(" " + ciValue.getValue()); + return ciValue; + }).collect(Collectors.toList()); + + list.addAll(spacePrefixedList); } + if(autoCompleteSuggestions != null) { // the value needs to be prefixed with a space character to bump it to the top of the list - list.add(new CustomCIValue(" Custom Entry...", this, autoCompleteSuggestions.autoCompleteContext)); + list.add(new CustomCIValue(" \uD83D\uDC49Custom lookup...", this, autoCompleteSuggestions.autoCompleteContext)); } }