diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/ProctorRoomConnectionsPopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/ProctorRoomConnectionsPopup.java index 30128c14..3517957a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/ProctorRoomConnectionsPopup.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/ProctorRoomConnectionsPopup.java @@ -48,6 +48,9 @@ public class ProctorRoomConnectionsPopup { private static final LocTextKey TITLE_TEXT_KEY = new LocTextKey("sebserver.monitoring.exam.proctoring.room.connections.title"); + private static final LocTextKey JOIN_TEXT_KEY = + new LocTextKey("sebserver.monitoring.exam.proctoring.room.connections.joinurl"); + private static final LocTextKey EMPTY_LIST_TEXT_KEY = new LocTextKey("sebserver.monitoring.search.list.empty"); private static final LocTextKey TABLE_COLUMN_NAME = @@ -81,16 +84,19 @@ public class ProctorRoomConnectionsPopup { if (StringUtils.isNotBlank(joinLink)) { final WidgetFactory widgetFactory = this.pageService.getWidgetFactory(); + final String ariaLabel = widgetFactory.getI18nSupport().getText(JOIN_TEXT_KEY) + joinLink; + final String testKey = JOIN_TEXT_KEY.name; + final Composite titleComp = widgetFactory.voidComposite(pageContext.getParent()); final GridLayout layout = (GridLayout) titleComp.getLayout(); layout.numColumns = 2; layout.makeColumnsEqualWidth = false; - final Label label = widgetFactory.label(titleComp, "Join URL: "); + final Label label = widgetFactory.labelLocalized(titleComp, JOIN_TEXT_KEY); label.setLayoutData(new GridData()); label.setData(RWT.CUSTOM_VARIANT, CustomVariant.TITLE_LABEL.key); - final Text textInput = widgetFactory.textInput(titleComp, joinLink); + final Text textInput = widgetFactory.textInput(titleComp, testKey, ariaLabel); final GridData gridData = new GridData(SWT.LEFT, SWT.TOP, false, false); textInput.setLayoutData(gridData); textInput.setText(joinLink); 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 151c0e60..53b43572 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 @@ -76,7 +76,7 @@ public final class SelectionFieldBuilder extends FieldBuilder { (builder.pageService.getFormTooltipMode() == PageService.FormTooltipMode.INPUT) ? this.tooltip : null, null, actionKey, - getARIALabel(builder)); + builder.i18nSupport.getText(getARIALabel(builder))); final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false); ((Control) selection).setLayoutData(gridData); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CheckBoxBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CheckBoxBuilder.java index 7230251c..ea99ea8f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CheckBoxBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CheckBoxBuilder.java @@ -75,6 +75,7 @@ public class CheckBoxBuilder implements InputFieldBuilder { ? ExamConfigurationService.attributeNameLocKey(attribute) : null, ExamConfigurationService.getToolTipKey(attribute, i18nSupport), + ExamConfigurationService.attributeNameLocKey(attribute).name, ExamConfigurationService.attributeNameLocKey(attribute)); final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/MultiCheckboxSelection.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/MultiCheckboxSelection.java index c04d2059..e9fd3db3 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/MultiCheckboxSelection.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/MultiCheckboxSelection.java @@ -21,6 +21,7 @@ import ch.ethz.seb.sebserver.gbl.profile.GuiProfile; import ch.ethz.seb.sebserver.gui.service.examconfig.ExamConfigurationService; import ch.ethz.seb.sebserver.gui.service.examconfig.InputField; import ch.ethz.seb.sebserver.gui.service.examconfig.InputFieldBuilder; +import ch.ethz.seb.sebserver.gui.service.i18n.I18nSupport; import ch.ethz.seb.sebserver.gui.widget.MultiSelectionCheckbox; import ch.ethz.seb.sebserver.gui.widget.Selection; import ch.ethz.seb.sebserver.gui.widget.WidgetFactory; @@ -50,18 +51,21 @@ public class MultiCheckboxSelection extends SelectionFieldBuilder implements Inp final ConfigurationAttribute attribute, final ViewContext viewContext) { + final I18nSupport i18nSupport = this.widgetFactory.getI18nSupport(); final Orientation orientation = viewContext .getOrientation(attribute.id); final Composite innerGrid = InputFieldBuilder .createInnerGrid(parent, attribute, orientation); + final String attributeNameKey = ExamConfigurationService.attributeNameKey(attribute); final MultiSelectionCheckbox selection = this.widgetFactory.selectionLocalized( Selection.Type.MULTI_CHECKBOX, innerGrid, () -> this.getLocalizedResources(attribute, viewContext), null, () -> this.getLocalizedResourcesAsToolTip(attribute, viewContext), - ExamConfigurationService.ATTRIBUTE_LABEL_LOC_TEXT_PREFIX + attribute.name) + attributeNameKey, + i18nSupport.getText(attributeNameKey)) .getTypeInstance(); selection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/PasswordFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/PasswordFieldBuilder.java index 173affd7..4f73bed8 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/PasswordFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/PasswordFieldBuilder.java @@ -37,6 +37,8 @@ import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant; @GuiProfile public class PasswordFieldBuilder implements InputFieldBuilder { + private static final String SEBSERVER_FORM_CONFIRM_LABEL = "sebserver.form.confirm.label"; + private static final LocTextKey VAL_CONFIRM_PWD_TEXT_KEY = new LocTextKey("sebserver.examconfig.props.validation.password.confirm"); @@ -84,7 +86,7 @@ public class PasswordFieldBuilder implements InputFieldBuilder { final LocTextKey confirmNameLocKey = new LocTextKey( - "sebserver.form.confirm.label", + SEBSERVER_FORM_CONFIRM_LABEL, viewContext.i18nSupport.getText(attributeNameLocKey)); final PasswordInput confirmInput = new PasswordInput( innerGrid, diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/RadioSelectionFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/RadioSelectionFieldBuilder.java index 740c8b4c..f51a2179 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/RadioSelectionFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/RadioSelectionFieldBuilder.java @@ -22,6 +22,7 @@ import ch.ethz.seb.sebserver.gbl.profile.GuiProfile; import ch.ethz.seb.sebserver.gui.service.examconfig.ExamConfigurationService; import ch.ethz.seb.sebserver.gui.service.examconfig.InputField; import ch.ethz.seb.sebserver.gui.service.examconfig.InputFieldBuilder; +import ch.ethz.seb.sebserver.gui.service.i18n.I18nSupport; import ch.ethz.seb.sebserver.gui.widget.RadioSelection; import ch.ethz.seb.sebserver.gui.widget.Selection; import ch.ethz.seb.sebserver.gui.widget.WidgetFactory; @@ -52,18 +53,21 @@ public class RadioSelectionFieldBuilder extends SelectionFieldBuilder implements final ConfigurationAttribute attribute, final ViewContext viewContext) { + final I18nSupport i18nSupport = this.widgetFactory.getI18nSupport(); final Orientation orientation = viewContext .getOrientation(attribute.id); final Composite innerGrid = InputFieldBuilder .createInnerGrid(parent, attribute, orientation); + final String attributeNameKey = ExamConfigurationService.attributeNameKey(attribute); final RadioSelection selection = this.widgetFactory.selectionLocalized( Selection.Type.RADIO, innerGrid, () -> this.getLocalizedResources(attribute, viewContext), null, () -> this.getLocalizedResourcesAsToolTip(attribute, viewContext), - ExamConfigurationService.ATTRIBUTE_LABEL_LOC_TEXT_PREFIX + attribute.name) + attributeNameKey, + i18nSupport.getText(attributeNameKey)) .getTypeInstance(); selection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/SingleSelectionFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/SingleSelectionFieldBuilder.java index 335c5c5c..040c2def 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/SingleSelectionFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/SingleSelectionFieldBuilder.java @@ -24,6 +24,7 @@ import ch.ethz.seb.sebserver.gui.service.examconfig.ExamConfigurationService; import ch.ethz.seb.sebserver.gui.service.examconfig.InputField; import ch.ethz.seb.sebserver.gui.service.examconfig.InputFieldBuilder; import ch.ethz.seb.sebserver.gui.service.i18n.I18nSupport; +import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey; import ch.ethz.seb.sebserver.gui.widget.Selection; import ch.ethz.seb.sebserver.gui.widget.SingleSelection; import ch.ethz.seb.sebserver.gui.widget.WidgetFactory; @@ -60,13 +61,18 @@ public class SingleSelectionFieldBuilder extends SelectionFieldBuilder implement final Composite innerGrid = InputFieldBuilder .createInnerGrid(parent, attribute, orientation); + final LocTextKey toolTipKey = ExamConfigurationService.getToolTipKey(attribute, i18nSupport); + final String attributeNameKey = ExamConfigurationService.attributeNameKey(attribute); final SingleSelection selection = this.widgetFactory.selectionLocalized( (attribute.type == AttributeType.COMBO_SELECTION) ? Selection.Type.SINGLE_COMBO : Selection.Type.SINGLE, innerGrid, () -> this.getLocalizedResources(attribute, viewContext), - ExamConfigurationService.getToolTipKey(attribute, i18nSupport)) + toolTipKey, + null, + attributeNameKey, + i18nSupport.getText(attributeNameKey)) .getTypeInstance(); selection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TextFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TextFieldBuilder.java index fa853f88..c91d8d84 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TextFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TextFieldBuilder.java @@ -87,6 +87,9 @@ public class TextFieldBuilder implements InputFieldBuilder { } } text.setLayoutData(gridData); + final String attributeNameKey = ExamConfigurationService.attributeNameKey(attribute); + WidgetFactory.setTestId(text, attributeNameKey); + WidgetFactory.setARIALabel(text, i18nSupport.getText(attributeNameKey)); final LocTextKey toolTipKey = ExamConfigurationService.getToolTipKey( attribute, diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/table/TableFilter.java b/src/main/java/ch/ethz/seb/sebserver/gui/table/TableFilter.java index 8ecae21c..78221463 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/table/TableFilter.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/table/TableFilter.java @@ -328,6 +328,7 @@ public class TableFilter { this.textInput = TableFilter.this.entityTable.widgetFactory.textInput( innerComposite, + TableFilter.this.entityTable.getName() + "_" + this.attribute.columnName, getAriaLabel()); this.textInput.setLayoutData(gridData); @@ -354,7 +355,6 @@ public class TableFilter { this.textInput.setText(value); } } - } private class SelectionFilter extends FilterComponent { @@ -387,7 +387,9 @@ public class TableFilter { ch.ethz.seb.sebserver.gui.widget.Selection.Type.SINGLE, innerComposite, resourceSupplier, - getAriaLabel()); + null, null, + TableFilter.this.entityTable.getName() + "_" + this.attribute.columnName, + TableFilter.this.entityTable.widgetFactory.getI18nSupport().getText(getAriaLabel())); this.selector .adaptToControl() @@ -446,7 +448,8 @@ public class TableFilter { final Composite innerComposite = createInnerComposite(parent); this.selector = TableFilter.this.entityTable.widgetFactory.dateSelector( innerComposite, - getAriaLabel()); + getAriaLabel(), + TableFilter.this.entityTable.getName() + "_" + this.attribute.columnName); this.selector.addListener(SWT.Selection, event -> { TableFilter.this.entityTable.applyFilter(); }); @@ -540,26 +543,27 @@ public class TableFilter { this.innerComposite.setLayout(gridLayout); this.innerComposite.setLayoutData(this.rowData); + final String testKey = TableFilter.this.entityTable.getName() + "_" + this.attribute.columnName; final WidgetFactory wf = TableFilter.this.entityTable.widgetFactory; wf.labelLocalized(this.innerComposite, DATE_FROM_TEXT); - this.fromDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel()); + this.fromDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel(), testKey); this.fromDateSelector.addListener(SWT.Selection, event -> { TableFilter.this.entityTable.applyFilter(); }); if (this.withTime) { - this.fromTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel()); + this.fromTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel(), testKey); this.fromTimeSelector.addListener(SWT.Selection, event -> { TableFilter.this.entityTable.applyFilter(); }); } wf.labelLocalized(this.innerComposite, DATE_TO_TEXT); - this.toDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel()); + this.toDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel(), testKey); this.toDateSelector.addListener(SWT.Selection, event -> { TableFilter.this.entityTable.applyFilter(); }); if (this.withTime) { - this.toTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel()); + this.toTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel(), testKey); this.toTimeSelector.addListener(SWT.Selection, event -> { TableFilter.this.entityTable.applyFilter(); }); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java index 8d1b8871..69a642fe 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java @@ -96,6 +96,10 @@ public final class ColorSelection extends Composite implements Selection { actionCell.widthHint = ACTION_COLUMN_WIDTH; imageButton.setLayoutData(actionCell); + if (tooltipKeyPrefix != null) { + WidgetFactory.setTestId(this, tooltipKeyPrefix); + } + this.addListener(SWT.Resize, this::adaptColumnWidth); } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java index 8cafb7e9..839ad680 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java @@ -33,10 +33,11 @@ public final class MultiSelection extends Composite implements Selection { private final List