From c2fc86799cabb20a9b00e0729969b603fc9e9ea1 Mon Sep 17 00:00:00 2001 From: Tomas Peiretti Date: Fri, 2 Aug 2024 09:09:41 -0300 Subject: [PATCH] refactor: improve getLocaleRenderer readability --- .../vaadin/addons/localecombobox/LocaleComboBox.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/flowingcode/vaadin/addons/localecombobox/LocaleComboBox.java b/src/main/java/com/flowingcode/vaadin/addons/localecombobox/LocaleComboBox.java index 7814ceb..014fd97 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/localecombobox/LocaleComboBox.java +++ b/src/main/java/com/flowingcode/vaadin/addons/localecombobox/LocaleComboBox.java @@ -56,10 +56,14 @@ public LocaleComboBox() { private LitRenderer getLocaleRenderer() { return LitRenderer - .of("" - + "" + "${item.displayName}" - + "") + .of( + """ + + + ${item.displayName} + """) + .withProperty("layoutClass", loc -> ITEM_LAYOUT_CLASS_NAME) + .withProperty("flagClass", loc -> ITEM_FLAG_CLASS_NAME) .withProperty("countryCode", loc -> loc.getCountry().toLowerCase()) .withProperty("countryName", loc -> loc.getDisplayCountry()) .withProperty("displayName", loc -> loc.getDisplayName());