From a7de01851d59cc01bb465a3e4b7c592cfbcebaee Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 7 Feb 2022 17:27:00 +0100 Subject: [PATCH] SEBSERV-155 add empty note for not selected exam supporters --- src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java | 7 +++++++ .../ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java b/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java index 2cbe734c..f9c9a20e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java @@ -697,4 +697,11 @@ public final class Utils { + Constants.DOUBLE_QUOTE; } + public static String getOrEmptyDisplayValue(final String value) { + if (StringUtils.isBlank(value)) { + return Constants.EMPTY_NOTE; + } + return value; + } + } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java index 0fc30983..5a417d9e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java @@ -110,7 +110,7 @@ public final class SelectionFieldBuilder extends FieldBuilder { final GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, true); label.setLayoutData(gridData); - label.setText((this.value != null) ? this.value : Constants.EMPTY_NOTE); + label.setText(Constants.EMPTY_NOTE); if (this.label != null) { WidgetFactory.setTestId(label, this.label.name); }