From ff49693b4dc4d2188723c95f2d66f07495f94b6f Mon Sep 17 00:00:00 2001 From: Frank Delporte Date: Tue, 7 Nov 2023 19:20:47 +0100 Subject: [PATCH] Do not show UNKNOWN in the list of boards --- .../java/com/pi4j/boardinfoservice/views/BoardInfoView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/pi4j/boardinfoservice/views/BoardInfoView.java b/src/main/java/com/pi4j/boardinfoservice/views/BoardInfoView.java index f9f0013..bc2fb3a 100644 --- a/src/main/java/com/pi4j/boardinfoservice/views/BoardInfoView.java +++ b/src/main/java/com/pi4j/boardinfoservice/views/BoardInfoView.java @@ -62,9 +62,11 @@ public BoardInfoView() { @Override public void onAttach(AttachEvent event) { - UI.getCurrent().access(() -> listBox.setItems(Arrays.stream(BoardModel.values()) + var listWithoutUnknown = Arrays.stream(BoardModel.values()) + .filter(bm -> bm != BoardModel.UNKNOWN) .sorted(Comparator.comparing(BoardModel::getLabel)) - .toList())); + .toList(); + UI.getCurrent().access(() -> listBox.setItems(listWithoutUnknown)); } private void showBoard(BoardModel boardModel) {