From 1ff1880d11f8cd40e7c1ed85a35a957a338fe38d Mon Sep 17 00:00:00 2001 From: Quincy Cantu Date: Wed, 13 Nov 2024 13:28:09 -0700 Subject: [PATCH] Sort headers in dropdowns to ignore case --- .../java/edu/colorado/cires/pace/gui/BaseTranslatorForm.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pace-gui/src/main/java/edu/colorado/cires/pace/gui/BaseTranslatorForm.java b/pace-gui/src/main/java/edu/colorado/cires/pace/gui/BaseTranslatorForm.java index bddd5429..4d16e567 100644 --- a/pace-gui/src/main/java/edu/colorado/cires/pace/gui/BaseTranslatorForm.java +++ b/pace-gui/src/main/java/edu/colorado/cires/pace/gui/BaseTranslatorForm.java @@ -3,6 +3,7 @@ import edu.colorado.cires.pace.data.object.base.Translator; import java.util.Arrays; import java.util.Collections; +import java.util.Comparator; import java.util.HashSet; import java.util.Set; import java.util.UUID; @@ -42,7 +43,7 @@ public String[] getHeaderOptions() { public void setHeaderOptions(String[] headerOptions) { this.headerOptions = Arrays.stream(headerOptions) .filter(StringUtils::isNotEmpty) - .collect(Collectors.toSet()).stream().sorted().toArray(String[]::new); + .collect(Collectors.toSet()).stream().sorted(Comparator.comparing(String::new, String.CASE_INSENSITIVE_ORDER)).toArray(String[]::new); this.headerOptions = ArrayUtils.addFirst(this.headerOptions, null); updateHeaderOptions(this.headerOptions); }