Skip to content

Commit

Permalink
Merge branch 'BCDH:master' into fix/license
Browse files Browse the repository at this point in the history
  • Loading branch information
marmoure authored Nov 20, 2023
2 parents ca106c0 + 82081f7 commit ebbe06e
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

import java.awt.*;
import java.util.List;
import java.util.stream.Collectors;

/**
* TEI-Completer
Expand Down Expand Up @@ -90,12 +91,19 @@ public String getDescription() {
public List<CIValue> filterAttributeValues(final List<CIValue> list, final WhatPossibleValuesHasAttributeContext context) {
if (context != null) {
final AutoCompleteSuggestions<AutoComplete> autoCompleteSuggestions = getAutoCompleteSuggestions(context);

if(autoCompleteSuggestions != null) {
list.addAll(autoCompleteSuggestions.getSuggestions());
List<CIValue> spacePrefixedList = autoCompleteSuggestions.getSuggestions().stream().map(ciValue -> {
ciValue.setValue(" " + ciValue.getValue());
return ciValue;
}).collect(Collectors.toList());

list.addAll(spacePrefixedList);
}
if(autoCompleteSuggestions != null && autoCompleteSuggestions.getSuggestions().size() == 0) {

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 lookup...", this, autoCompleteSuggestions.autoCompleteContext));
list.add(new CustomCIValue("\uD83D\uDC49 Custom lookup...", this, autoCompleteSuggestions.autoCompleteContext));
}

}
Expand Down

0 comments on commit ebbe06e

Please sign in to comment.