fixed errors

This commit is contained in:
anhefti 2021-12-01 14:54:11 +01:00
parent 70c4fe1571
commit 6a989f50b2

View file

@ -399,7 +399,11 @@ public class WidgetFactory {
final Button button = new Button(parent, type); final Button button = new Button(parent, type);
setARIARole(button, AriaRole.button); setARIARole(button, AriaRole.button);
setTestId(button, locTextKey.name); if (locTextKey != null) {
setTestId(button, locTextKey.name);
} else if (toolTipKey != null) {
setTestId(button, toolTipKey.name);
}
this.polyglotPageService.injectI18n(button, locTextKey, toolTipKey); this.polyglotPageService.injectI18n(button, locTextKey, toolTipKey);
return button; return button;
} }
@ -781,7 +785,13 @@ public class WidgetFactory {
final Supplier<List<Tuple<String>>> itemsSupplier, final Supplier<List<Tuple<String>>> itemsSupplier,
final LocTextKey toolTipTextKey) { final LocTextKey toolTipTextKey) {
return this.selectionLocalized(type, parent, itemsSupplier, toolTipTextKey, null, toolTipTextKey.name); return this.selectionLocalized(
type,
parent,
itemsSupplier,
toolTipTextKey,
null,
(toolTipTextKey != null) ? toolTipTextKey.name : null);
} }
public Selection selectionLocalized( public Selection selectionLocalized(
@ -791,8 +801,13 @@ public class WidgetFactory {
final LocTextKey toolTipTextKey, final LocTextKey toolTipTextKey,
final Supplier<List<Tuple<String>>> itemsToolTipSupplier) { final Supplier<List<Tuple<String>>> itemsToolTipSupplier) {
return selectionLocalized(type, parent, itemsSupplier, toolTipTextKey, itemsToolTipSupplier, return selectionLocalized(
toolTipTextKey.name); type,
parent,
itemsSupplier,
toolTipTextKey,
itemsToolTipSupplier,
(toolTipTextKey != null) ? toolTipTextKey.name : null);
} }
public Selection selectionLocalized( public Selection selectionLocalized(