diff --git a/articles/components/_input-field-common-features.adoc b/articles/components/_input-field-common-features.adoc
index 4d30cd0abf..a87e036842 100644
--- a/articles/components/_input-field-common-features.adoc
+++ b/articles/components/_input-field-common-features.adoc
@@ -220,7 +220,7 @@ The following style variants can be applied:
// end::styles-intro[]
-//tag::text-alignment[]
+// tag::text-alignment[]
[#text-alignment]
.Text Alignment
[%collapsible]
@@ -229,30 +229,30 @@ Three different text alignments are supported: `left`, which is the default; `ce
Right-alignment is recommended for numerical values when presented in vertical groups. This tends to aid interpretation and comparison of values.
====
-//end::text-alignment[]
+// end::text-alignment[]
-//tag::small-variant[]
+// tag::small-variant[]
[#small-variant]
.Small Variant
[%collapsible]
====
The small variant can be used to make individual fields more compact. The default size of fields can be customized with <<{articles}/styling/lumo/lumo-style-properties#,style properties>>.
====
-//end::small-variant[]
+// end::small-variant[]
-//tag::helper-above-field[]
+// tag::helper-above-field[]
[#helper-above-field]
.Helper Above Field
[%collapsible]
====
The helper can be rendered above the field, and below the label.
====
-//end::helper-above-field[]
+// end::helper-above-field[]
-//tag::borders[]
+// tag::borders[]
[#borders]
.[since:com.vaadin:vaadin@V24.1]#Borders#
[%collapsible]
@@ -261,4 +261,4 @@ Borders can be applied to the field surface by providing a value (e.g., `1px`) t
You can override the default border color with the `--vaadin-input-field-border-color` property.
====
-//end::borders[]
+// end::borders[]
diff --git a/articles/components/_shared-code-snippets.adoc b/articles/components/_shared-code-snippets.adoc
index b9b74d7a91..d268b5b395 100644
--- a/articles/components/_shared-code-snippets.adoc
+++ b/articles/components/_shared-code-snippets.adoc
@@ -1,4 +1,4 @@
-//tag::aria-label-java[]
+// tag::aria-label-java[]
// Associates external element as label:
NativeLabel label = new NativeLabel("This is the label");
label.setId("external-label");
@@ -6,32 +6,32 @@ field.setAriaLabelledBy("external-label");
// Invisible label for screen readers:
field.setAriaLabel("This is the label");
-//end::aria-label-java[]
+// end::aria-label-java[]
-//tag::aria-label-typescript[]
+// tag::aria-label-typescript[]
<{tag-name} accessible-name-ref="external-label">...
<{tag-name} accessible-name="This is the label">...
-//end::aria-label-typescript[]
+// end::aria-label-typescript[]
-//tag::aria-label-dtp-java[]
+// tag::aria-label-dtp-java[]
// Invisible label for screen readers:
field.setAriaLabel("Meeting");
// Suffixes for sub-fields:
field.setDateAriaLabel("date"); // -> "Meeting date"
field.setDateAriaLabel("time"); // -> "Meeting time"
-//end::aria-label-dtp-java[]
+// end::aria-label-dtp-java[]
-//tag::aria-label-dtp-typescript[]
+// tag::aria-label-dtp-typescript[]
...
-//end::aria-label-dtp-typescript[]
+// end::aria-label-dtp-typescript[]
diff --git a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsExpandingItems.java b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsExpandingItems.java
index 7887ceab7a..ad465f0d7b 100644
--- a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsExpandingItems.java
+++ b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsExpandingItems.java
@@ -17,15 +17,15 @@ public BasicLayoutsExpandingItems() {
// end::snippet[]
layout.setPadding(true);
layout.add(item1);
-
+
Div item2 = new Div("Item 2");
item2.setClassName("example-item");
layout.add(item2);
-
+
Div item3 = new Div("Item 3");
item3.setClassName("example-item");
layout.add(item3);
-
+
this.add(layout);
this.setClassName("basic-layouts-example");
}
diff --git a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutSpacing.java b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutSpacing.java
index 5a927903b7..06d26f642f 100644
--- a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutSpacing.java
+++ b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutSpacing.java
@@ -12,7 +12,8 @@ public class BasicLayoutsHorizontalLayoutSpacing extends Div {
public BasicLayoutsHorizontalLayoutSpacing() {
add(new Paragraph("Horizontal layout without spacing:"));
// tag::snippet[]
- // HorizontalLayout has spacing enabled by default, use setSpacing to disable it
+ // HorizontalLayout has spacing enabled by default, use setSpacing to
+ // disable it
HorizontalLayout layoutWithoutSpacing = new HorizontalLayout();
layoutWithoutSpacing.setSpacing(false);
// end::snippet[]
diff --git a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutWrapping.java b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutWrapping.java
index 4de56b809e..a0d93bec35 100644
--- a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutWrapping.java
+++ b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsHorizontalLayoutWrapping.java
@@ -52,7 +52,8 @@ public BasicLayoutsHorizontalLayoutWrapping() {
Div wrapItem5 = new Div("Item 5");
wrapItem5.setClassName("example-item");
- layoutWithWrap.add(wrapItem1, wrapItem2, wrapItem3, wrapItem4, wrapItem5);
+ layoutWithWrap.add(wrapItem1, wrapItem2, wrapItem3, wrapItem4,
+ wrapItem5);
this.setClassName("basic-layouts-example");
this.add(layoutWithWrap);
diff --git a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsPadding.java b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsPadding.java
index b00ce97924..2b1b3a8cd8 100644
--- a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsPadding.java
+++ b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsPadding.java
@@ -22,7 +22,8 @@ public BasicLayoutsPadding() {
parent.add(wrapper);
// tag::snippet[]
- // VerticalLayout has padding enabled by default, use setPadding to disable it
+ // VerticalLayout has padding enabled by default, use setPadding to
+ // disable it
VerticalLayout layoutWithoutPadding = new VerticalLayout();
layoutWithoutPadding.setPadding(false);
// end::snippet[]
diff --git a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsSpacing.java b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsSpacing.java
index 9cc91ba6ce..2f1f71f492 100644
--- a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsSpacing.java
+++ b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsSpacing.java
@@ -22,7 +22,8 @@ public BasicLayoutsSpacing() {
parent.add(wrapper);
// tag::snippet[]
- // VerticalLayout has spacing enabled by default, use setSpacing to disable it
+ // VerticalLayout has spacing enabled by default, use setSpacing to
+ // disable it
VerticalLayout layoutWithoutSpacing = new VerticalLayout();
layoutWithoutSpacing.setSpacing(false);
// end::snippet[]
diff --git a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsVerticalLayoutWrapping.java b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsVerticalLayoutWrapping.java
index aa17ae5cbd..380b354f50 100644
--- a/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsVerticalLayoutWrapping.java
+++ b/src/main/java/com/vaadin/demo/component/basiclayouts/BasicLayoutsVerticalLayoutWrapping.java
@@ -26,7 +26,7 @@ public BasicLayoutsVerticalLayoutWrapping() {
layoutWithoutWrap.setSpacing(true);
layoutWithoutWrap.setAlignItems(FlexComponent.Alignment.STRETCH);
layoutWithoutWrap.setHeight("200px");
-
+
Div item1 = new Div("Item 1");
item1.setClassName("example-item");
Div item2 = new Div("Item 2");
@@ -35,7 +35,7 @@ public BasicLayoutsVerticalLayoutWrapping() {
item3.setClassName("example-item");
Div item4 = new Div("Item 4");
item4.setClassName("example-item");
-
+
layoutWithoutWrap.add(item1, item2, item3, item4);
wrapper.add(layoutWithoutWrap);
parent.add(wrapper);
@@ -52,7 +52,7 @@ public BasicLayoutsVerticalLayoutWrapping() {
layoutWithWrap.setSpacing(true);
layoutWithWrap.setAlignItems(FlexComponent.Alignment.STRETCH);
layoutWithWrap.setHeight("200px");
-
+
Div wrapItem1 = new Div("Item 1");
wrapItem1.setClassName("example-item");
Div wrapItem2 = new Div("Item 2");
@@ -61,7 +61,7 @@ public BasicLayoutsVerticalLayoutWrapping() {
wrapItem3.setClassName("example-item");
Div wrapItem4 = new Div("Item 4");
wrapItem4.setClassName("example-item");
-
+
layoutWithWrap.add(wrapItem1, wrapItem2, wrapItem3, wrapItem4);
wrapper.add(layoutWithWrap);
parent.add(wrapper);
diff --git a/src/main/java/com/vaadin/demo/component/contextmenu/ContextMenuDisableOnClick.java b/src/main/java/com/vaadin/demo/component/contextmenu/ContextMenuDisableOnClick.java
index a151494b9d..c1f7560e25 100644
--- a/src/main/java/com/vaadin/demo/component/contextmenu/ContextMenuDisableOnClick.java
+++ b/src/main/java/com/vaadin/demo/component/contextmenu/ContextMenuDisableOnClick.java
@@ -12,7 +12,8 @@ public class ContextMenuDisableOnClick extends Div {
public ContextMenuDisableOnClick() {
Paragraph paragraph = new Paragraph();
- paragraph.setText("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.");
+ paragraph.setText(
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.");
add(paragraph);
ContextMenu menu = new ContextMenu(paragraph);
@@ -33,6 +34,7 @@ public ContextMenuDisableOnClick() {
});
}
- public static class Exporter extends DemoExporter { // hidden-source-line
+ public static class Exporter // hidden-source-line
+ extends DemoExporter { // hidden-source-line
} // hidden-source-line
}
diff --git a/src/main/java/com/vaadin/demo/component/dashboard/DashboardAnnouncements.java b/src/main/java/com/vaadin/demo/component/dashboard/DashboardAnnouncements.java
index 40b69fc857..7a8dbbffbc 100644
--- a/src/main/java/com/vaadin/demo/component/dashboard/DashboardAnnouncements.java
+++ b/src/main/java/com/vaadin/demo/component/dashboard/DashboardAnnouncements.java
@@ -30,7 +30,8 @@ public DashboardAnnouncements() {
conversions.setContent(createWidgetContent());
dashboard.add(conversions);
- DashboardWidget visitorsByCountry = new DashboardWidget("Visitors by country");
+ DashboardWidget visitorsByCountry = new DashboardWidget(
+ "Visitors by country");
visitorsByCountry.setContent(createWidgetContent());
visitorsByCountry.setRowspan(2);
dashboard.add(visitorsByCountry);
@@ -43,16 +44,18 @@ public DashboardAnnouncements() {
catImage.setContent(createWidgetContent());
dashboard.add(catImage);
- DashboardWidget visitorsByBrowser = new DashboardWidget("Visitors by browser");
+ DashboardWidget visitorsByBrowser = new DashboardWidget(
+ "Visitors by browser");
visitorsByBrowser.setContent(createWidgetContent());
visitorsByBrowser.setColspan(2);
dashboard.add(visitorsByBrowser);
// tag::snippet[]
- // Live region for screen reader announcements. Changing its text content will result
- // in a new announcement. This element is only visible for demonstration purposes. In
- // your application you should visually hide it using CSS, for example by using the
- // sr-only Lumo utility class:
+ // Live region for screen reader announcements. Changing its text
+ // content will result in a new announcement. This element is only
+ // visible for demonstration purposes. In your application you should
+ // visually hide it using CSS, for example by using the sr-only Lumo
+ // utility class:
// liveRegion.addClassName(LumoUtility.Accessibility.SCREEN_READER_ONLY)
Div liveRegion = new Div();
liveRegion.getElement().setAttribute("aria-live", "polite");
@@ -60,7 +63,7 @@ public DashboardAnnouncements() {
// This event is fired when the user starts or stops editing a widget
dashboard.addItemSelectedChangedListener(event -> {
- String title = ((DashboardWidget)event.getItem()).getTitle();
+ String title = ((DashboardWidget) event.getItem()).getTitle();
String selected = event.isSelected() ? "selected" : "deselected";
liveRegion.setText("Widget " + title + " " + selected);
@@ -88,9 +91,10 @@ public DashboardAnnouncements() {
dashboard.addItemMovedListener(event -> {
int position = event.getItems().indexOf(event.getItem()) + 1;
int total = event.getItems().size();
- String title = ((DashboardWidget)event.getItem()).getTitle();
+ String title = ((DashboardWidget) event.getItem()).getTitle();
- liveRegion.setText("Moved widget " + title + " to position " + position + " of " + total);
+ liveRegion.setText("Moved widget " + title + " to position "
+ + position + " of " + total);
});
// This event is fired when the user resizes a widget
@@ -99,12 +103,13 @@ public DashboardAnnouncements() {
int rowspan = event.getItem().getRowspan();
String title = event.getItem().getTitle();
- liveRegion.setText("Resized widget " + title + " to " + colspan + " columns, " + rowspan + " rows");
+ liveRegion.setText("Resized widget " + title + " to " + colspan
+ + " columns, " + rowspan + " rows");
});
// This event is fired when the user removes a widget
dashboard.addItemRemovedListener(event -> {
- String title = ((DashboardWidget)event.getItem()).getTitle();
+ String title = ((DashboardWidget) event.getItem()).getTitle();
liveRegion.setText("Removed widget " + title);
});
diff --git a/src/main/java/com/vaadin/demo/component/dashboard/DashboardBasic.java b/src/main/java/com/vaadin/demo/component/dashboard/DashboardBasic.java
index 3b35b266c1..e9ab204f71 100644
--- a/src/main/java/com/vaadin/demo/component/dashboard/DashboardBasic.java
+++ b/src/main/java/com/vaadin/demo/component/dashboard/DashboardBasic.java
@@ -27,7 +27,8 @@ public DashboardBasic() {
conversions.setContent(createWidgetContent());
dashboard.add(conversions);
- DashboardWidget visitorsByCountry = new DashboardWidget("Visitors by country");
+ DashboardWidget visitorsByCountry = new DashboardWidget(
+ "Visitors by country");
visitorsByCountry.setContent(createWidgetContent());
visitorsByCountry.setRowspan(2);
dashboard.add(visitorsByCountry);
@@ -40,7 +41,8 @@ public DashboardBasic() {
catImage.setContent(createWidgetContent());
dashboard.add(catImage);
- DashboardWidget visitorsByBrowser = new DashboardWidget("Visitors by browser");
+ DashboardWidget visitorsByBrowser = new DashboardWidget(
+ "Visitors by browser");
visitorsByBrowser.setContent(createWidgetContent());
visitorsByBrowser.setColspan(2);
dashboard.add(visitorsByBrowser);
diff --git a/src/main/java/com/vaadin/demo/component/dashboard/DashboardEditable.java b/src/main/java/com/vaadin/demo/component/dashboard/DashboardEditable.java
index edefc463a4..a74898e2cf 100644
--- a/src/main/java/com/vaadin/demo/component/dashboard/DashboardEditable.java
+++ b/src/main/java/com/vaadin/demo/component/dashboard/DashboardEditable.java
@@ -18,11 +18,12 @@ public class DashboardEditable extends Div {
private Dashboard dashboard;
// tag::snippet[]
- // NOTE: This example uses the additional classes WidgetConfig and DashboardStorage,
- // which you can find by switching to the respective file tab.
+ // NOTE: This example uses the additional classes WidgetConfig and
+ // DashboardStorage, which you can find by switching to the respective file
+ // tab.
- // Since the default DashboardWidget class doesn't allow setting custom data,
- // we create a custom class that extends DashboardWidget, and add a
+ // Since the default DashboardWidget class doesn't allow setting custom
+ // data, we create a custom class that extends DashboardWidget, and add a
// field for storing the widget type.
public static class CustomWidget extends DashboardWidget {
private final WidgetConfig.WidgetType type;
@@ -37,17 +38,19 @@ public WidgetConfig.WidgetType getType() {
}
}
- // This is the default configuration for the dashboard. Note that the order of the
- // widgets in the list determines the order in which they are displayed in the dashboard.
+ // This is the default configuration for the dashboard. Note that the order
+ // of the widgets in the list determines the order in which they are
+ // displayed in the dashboard.
private final List defaultConfig = List.of(
new WidgetConfig(WidgetConfig.WidgetType.VISITORS, 1, 1),
new WidgetConfig(WidgetConfig.WidgetType.DOWNLOADS, 1, 1),
new WidgetConfig(WidgetConfig.WidgetType.CONVERSIONS, 1, 1),
new WidgetConfig(WidgetConfig.WidgetType.VISITORS_BY_COUNTRY, 1, 2),
- new WidgetConfig(WidgetConfig.WidgetType.BROWSER_DISTRIBUTION, 1, 1),
+ new WidgetConfig(WidgetConfig.WidgetType.BROWSER_DISTRIBUTION, 1,
+ 1),
new WidgetConfig(WidgetConfig.WidgetType.CAT_IMAGE, 1, 1),
- new WidgetConfig(WidgetConfig.WidgetType.VISITORS_BY_BROWSER, 2, 1)
- );
+ new WidgetConfig(WidgetConfig.WidgetType.VISITORS_BY_BROWSER, 2,
+ 1));
public DashboardEditable(DashboardStorage dashboardStorage) {
this.dashboardStorage = dashboardStorage;
@@ -89,8 +92,10 @@ private void createToolbar() {
load.addClickListener(event -> loadConfiguration());
MenuItem addWidget = toolbar.addItem("Add widget");
- for (WidgetConfig.WidgetType widgetType : WidgetConfig.WidgetType.values()) {
- addWidget.getSubMenu().addItem(widgetType.getLabel(), event -> addWidget(widgetType));
+ for (WidgetConfig.WidgetType widgetType : WidgetConfig.WidgetType
+ .values()) {
+ addWidget.getSubMenu().addItem(widgetType.getLabel(),
+ event -> addWidget(widgetType));
}
MenuItem restore = toolbar.addItem("Restore default");
@@ -101,13 +106,16 @@ private void createToolbar() {
}
private void saveConfiguration() {
- // To save the dashboard configuration, we iterate over the current widgets
- // in the dashboard and map them into configuration objects.
- List dashboardConfig = dashboard.getWidgets().stream().map(widget -> {
- // Cast to our custom widget class and extract type, colspan, and rowspan
- CustomWidget customWidget = (CustomWidget) widget;
- return new WidgetConfig(customWidget.getType(), widget.getColspan(), widget.getRowspan());
- }).toList();
+ // To save the dashboard configuration, we iterate over the current
+ // widgets in the dashboard and map them into configuration objects.
+ List dashboardConfig = dashboard.getWidgets().stream()
+ .map(widget -> {
+ // Cast to our custom widget class and extract type,
+ // colspan, and rowspan
+ CustomWidget customWidget = (CustomWidget) widget;
+ return new WidgetConfig(customWidget.getType(),
+ widget.getColspan(), widget.getRowspan());
+ }).toList();
// Then save the configuration to the database or other storage
// In this example, we just store it in a session-scoped bean
@@ -127,8 +135,8 @@ private void loadConfiguration() {
}
private void applyConfiguration(List dashboardConfig) {
- // To apply a dashboard configuration, we first clear the dashboard and then
- // create widgets based on the configuration
+ // To apply a dashboard configuration, we first clear the dashboard and
+ // then create widgets based on the configuration
dashboard.removeAll();
for (WidgetConfig config : dashboardConfig) {
CustomWidget widget = createWidget(config);
@@ -137,16 +145,19 @@ private void applyConfiguration(List dashboardConfig) {
}
private CustomWidget createWidget(WidgetConfig config) {
- // In this example all widget types have the same content, and the title is
- // stored in the enum, so we can use generic logic to create a widget
- CustomWidget widget = new CustomWidget(config.getType(), config.getType().getLabel());
+ // In this example all widget types have the same content, and the title
+ // is stored in the enum, so we can use generic logic to create a widget
+ CustomWidget widget = new CustomWidget(config.getType(),
+ config.getType().getLabel());
widget.setContent(createWidgetContent());
widget.setColspan(config.getColspan());
widget.setRowspan(config.getRowspan());
- // In practice, different widget types will have different content. In that case
- // you can use a switch statement to create the widget content based on the type.
+ // In practice, different widget types will have different content. In
+ // that case you can use a switch statement to create the widget content
+ // based on the type.
//
+ // @formatter:off hidden-source-line
// switch (config.type()) {
// case VISITORS:
// widget.setTitle("Visitors");
@@ -154,16 +165,16 @@ private CustomWidget createWidget(WidgetConfig config) {
// break;
// ...
// }
+ // @formatter:on hidden-source-line
return widget;
}
private void addWidget(WidgetConfig.WidgetType widgetType) {
- // For adding a new widget, we retrieve the default configuration for the widget type
- // and create a widget based on that configuration
+ // For adding a new widget, we retrieve the default configuration for
+ // the widget type and create a widget based on that configuration
WidgetConfig defaultWidgetConfig = defaultConfig.stream()
.filter(widgetConfig -> widgetConfig.getType() == widgetType)
- .findFirst()
- .orElseThrow();
+ .findFirst().orElseThrow();
CustomWidget widget = createWidget(defaultWidgetConfig);
dashboard.add(widget);
diff --git a/src/main/java/com/vaadin/demo/component/dashboard/DashboardSections.java b/src/main/java/com/vaadin/demo/component/dashboard/DashboardSections.java
index 99cc223ea5..fc7f48c387 100644
--- a/src/main/java/com/vaadin/demo/component/dashboard/DashboardSections.java
+++ b/src/main/java/com/vaadin/demo/component/dashboard/DashboardSections.java
@@ -16,7 +16,8 @@ public DashboardSections() {
dashboard.setMaximumColumnCount(3);
// tag::snippet[]
- DashboardSection statsSection = dashboard.addSection("Monthly Funnel Stats");
+ DashboardSection statsSection = dashboard
+ .addSection("Monthly Funnel Stats");
DashboardWidget visitors = new DashboardWidget("Visitors");
visitors.setContent(createWidgetContent());
@@ -31,8 +32,10 @@ public DashboardSections() {
statsSection.add(conversions);
// end::snippet[]
- DashboardSection detailsSection = dashboard.addSection("Visitor Details");
- DashboardWidget visitorsByCountry = new DashboardWidget("Visitors by country");
+ DashboardSection detailsSection = dashboard
+ .addSection("Visitor Details");
+ DashboardWidget visitorsByCountry = new DashboardWidget(
+ "Visitors by country");
visitorsByCountry.setContent(createWidgetContent());
visitorsByCountry.setRowspan(2);
detailsSection.add(visitorsByCountry);
@@ -45,7 +48,8 @@ public DashboardSections() {
catImage.setContent(createWidgetContent());
detailsSection.add(catImage);
- DashboardWidget visitorsByBrowser = new DashboardWidget("Visitors by browser");
+ DashboardWidget visitorsByBrowser = new DashboardWidget(
+ "Visitors by browser");
visitorsByBrowser.setContent(createWidgetContent());
visitorsByBrowser.setColspan(2);
detailsSection.add(visitorsByBrowser);
diff --git a/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerCustomValidation.java b/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerCustomValidation.java
index f8babcb46e..d4e0541c6a 100644
--- a/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerCustomValidation.java
+++ b/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerCustomValidation.java
@@ -23,7 +23,7 @@ public DateTimePickerCustomValidation() {
.setHelperText("Open Mondays-Fridays, 8:00-12:00, 13:00-16:00");
dateTimePicker.setStep(Duration.ofMinutes(30));
dateTimePicker.setI18n(new DateTimePickerI18n()
- .setBadInputErrorMessage("Invalid date or time format"));
+ .setBadInputErrorMessage("Invalid date or time format"));
add(dateTimePicker);
String errorMessage = "The selected day of week or time is not available";
diff --git a/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerValidation.java b/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerValidation.java
index 85c81bfbc5..e9fafc7221 100644
--- a/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerValidation.java
+++ b/src/main/java/com/vaadin/demo/component/datetimepicker/DateTimePickerValidation.java
@@ -22,10 +22,10 @@ public DateTimePickerValidation() {
dateTimePicker.setMax(LocalDateTime.now().plusDays(60));
dateTimePicker.setI18n(new DateTimePickerI18n()
- .setRequiredErrorMessage("Field is required")
- .setBadInputErrorMessage("Invalid date or time format")
- .setMinErrorMessage("Too early, choose another date and time")
- .setMaxErrorMessage("Too late, choose another date and time"));
+ .setRequiredErrorMessage("Field is required")
+ .setBadInputErrorMessage("Invalid date or time format")
+ .setMinErrorMessage("Too early, choose another date and time")
+ .setMaxErrorMessage("Too late, choose another date and time"));
add(dateTimePicker);
// end::snippet[]
diff --git a/src/main/java/com/vaadin/demo/component/grid/GridItemDetailsToggle.java b/src/main/java/com/vaadin/demo/component/grid/GridItemDetailsToggle.java
index 96f6542498..ce9adfd1a3 100644
--- a/src/main/java/com/vaadin/demo/component/grid/GridItemDetailsToggle.java
+++ b/src/main/java/com/vaadin/demo/component/grid/GridItemDetailsToggle.java
@@ -22,10 +22,8 @@ public class GridItemDetailsToggle extends Div {
public GridItemDetailsToggle() {
// tag::snippet1[]
Grid grid = new Grid<>(Person.class, false);
- grid.addColumn(createToggleDetailsRenderer(grid))
- .setWidth("80px")
- .setFlexGrow(0)
- .setFrozen(true);
+ grid.addColumn(createToggleDetailsRenderer(grid)).setWidth("80px")
+ .setFlexGrow(0).setFrozen(true);
grid.addColumn(Person::getFullName).setHeader("Name");
grid.addColumn(Person::getProfession).setHeader("Profession");
@@ -44,19 +42,22 @@ public GridItemDetailsToggle() {
// tag::snippet2[]
private static Renderer createToggleDetailsRenderer(
Grid grid) {
- return LitRenderer. of(
- """
-
-
-
+
+ // @formatter:off hidden-source-line
+ return LitRenderer
+ . of("""
+
+
+
""")
+ // @formatter:on hidden-source-line
.withFunction("handleClick",
person -> grid.setDetailsVisible(person,
!grid.isDetailsVisible(person)));
diff --git a/src/main/java/com/vaadin/demo/component/popover/PopoverNotificationPanel.java b/src/main/java/com/vaadin/demo/component/popover/PopoverNotificationPanel.java
index 0d3ed656a7..5121dc02be 100644
--- a/src/main/java/com/vaadin/demo/component/popover/PopoverNotificationPanel.java
+++ b/src/main/java/com/vaadin/demo/component/popover/PopoverNotificationPanel.java
@@ -73,7 +73,8 @@ public PopoverNotificationPanel() {
allList.setItems(Arrays.asList(message1, message2, message3, message4));
TabSheet tabSheet = new TabSheet();
- tabSheet.addThemeVariants(TabSheetVariant.LUMO_TABS_SMALL, TabSheetVariant.LUMO_NO_PADDING);
+ tabSheet.addThemeVariants(TabSheetVariant.LUMO_TABS_SMALL,
+ TabSheetVariant.LUMO_NO_PADDING);
tabSheet.addClassName("notifications");
Div unreadContent = new Div();
@@ -88,9 +89,11 @@ public PopoverNotificationPanel() {
Button markRead = new Button("Mark all read", (e) -> {
unreadContent.removeAll();
- unreadContent.add(new Div("No new notifications"){{
- this.addClassName("no-notifications-msg");
- }});
+ unreadContent.add(new Div("No new notifications") {
+ {
+ this.addClassName("no-notifications-msg");
+ }
+ });
});
markRead.getStyle().set("margin", "0 0 0 auto");
markRead.addThemeVariants(ButtonVariant.LUMO_SMALL);
diff --git a/src/main/java/com/vaadin/demo/component/upload/UploadDropLabel.java b/src/main/java/com/vaadin/demo/component/upload/UploadDropLabel.java
index 86dcc5fe7c..723c3cf7ee 100644
--- a/src/main/java/com/vaadin/demo/component/upload/UploadDropLabel.java
+++ b/src/main/java/com/vaadin/demo/component/upload/UploadDropLabel.java
@@ -38,7 +38,6 @@ private static Span createDropLabel() {
return new Span(cloudHint, policyLink);
}
- public static class Exporter extends // hidden-source-line
- DemoExporter { // hidden-source-line
+ public static class Exporter extends DemoExporter { // hidden-source-line
} // hidden-source-line
}
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/Employee.java b/src/main/java/com/vaadin/demo/fusion/crud/Employee.java
index f49895ea63..6d37b518c5 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/Employee.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/Employee.java
@@ -12,7 +12,7 @@
import java.time.LocalDate;
import java.time.LocalTime;
-//tag::snippet[]
+// tag::snippet[]
@Entity
public class Employee {
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/EmployeeRepository.java b/src/main/java/com/vaadin/demo/fusion/crud/EmployeeRepository.java
index e0d4185cf9..495b5e342f 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/EmployeeRepository.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/EmployeeRepository.java
@@ -3,7 +3,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-//tag::snippet[]
+// tag::snippet[]
public interface EmployeeRepository extends JpaRepository,
JpaSpecificationExecutor {
}
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/EmployeeService.java b/src/main/java/com/vaadin/demo/fusion/crud/EmployeeService.java
index 80b79dc82a..88e1027d69 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/EmployeeService.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/EmployeeService.java
@@ -1,6 +1,6 @@
package com.vaadin.demo.fusion.crud;
-//tag::snippet[]
+// tag::snippet[]
import com.vaadin.flow.server.auth.AnonymousAllowed;
import com.vaadin.hilla.BrowserCallable;
import com.vaadin.hilla.crud.CrudRepositoryService;
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/Product.java b/src/main/java/com/vaadin/demo/fusion/crud/Product.java
index a6ffbf87be..793011bd0c 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/Product.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/Product.java
@@ -8,7 +8,7 @@
import java.time.LocalDate;
-//tag::snippet[]
+// tag::snippet[]
@Entity
public class Product {
@Id
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDto.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDto.java
index 72e5473cea..7b23531000 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDto.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDto.java
@@ -1,6 +1,7 @@
package com.vaadin.demo.fusion.crud;
-//tag::snippet[]
+// @formatter:off hidden-source-line
+// tag::snippet[]
public record ProductAdvancedDto(Long productId,
String productName,
String productCategory,
@@ -10,7 +11,9 @@ public record ProductAdvancedDto(Long productId,
public static ProductAdvancedDto fromEntity(Product product) {
// Compute a custom property that includes the supplier name and city
String supplierInfo = product.getSupplier() != null
- ? String.format("%s (%s)", product.getSupplier().getSupplierName(), product.getSupplier().getHeadquarterCity())
+ ? String.format("%s (%s)",
+ product.getSupplier().getSupplierName(),
+ product.getSupplier().getHeadquarterCity())
: "";
return new ProductAdvancedDto(
@@ -23,4 +26,5 @@ public static ProductAdvancedDto fromEntity(Product product) {
);
}
}
-//end::snippet[]
+// end::snippet[]
+// @formatter:on hidden-source-line
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDtoListService.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDtoListService.java
index 1de641608e..18e3b0b8c3 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDtoListService.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDtoListService.java
@@ -11,7 +11,7 @@
import java.util.List;
-//tag::snippet[]
+// tag::snippet[]
@BrowserCallable
@AnonymousAllowed
public class ProductAdvancedDtoListService
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductDto.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductDto.java
index 96ca7a8ed6..d081fd9f3c 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductDto.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductDto.java
@@ -1,9 +1,10 @@
package com.vaadin.demo.fusion.crud;
-//tag::snippet[]
+// tag::snippet[]
public record ProductDto(Long id, String name, String category, double price) {
public static ProductDto fromEntity(Product product) {
- return new ProductDto(product.getId(), product.getName(), product.getCategory(), product.getPrice());
+ return new ProductDto(product.getId(), product.getName(),
+ product.getCategory(), product.getPrice());
}
}
-//end::snippet[]
+// end::snippet[]
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoCrudService.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoCrudService.java
index 3c49a04ef4..b591456181 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoCrudService.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoCrudService.java
@@ -11,7 +11,7 @@
import java.util.List;
-//tag::snippet[]
+// tag::snippet[]
@BrowserCallable
@AnonymousAllowed
public class ProductDtoCrudService implements CrudService {
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoFormService.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoFormService.java
index cce010e18e..5e0a636bd1 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoFormService.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoFormService.java
@@ -5,7 +5,7 @@
import com.vaadin.hilla.Nullable;
import com.vaadin.hilla.crud.FormService;
-//tag::snippet[]
+// tag::snippet[]
@BrowserCallable
@AnonymousAllowed
public class ProductDtoFormService implements FormService {
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoListService.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoListService.java
index 03cb59dd75..3755a67f11 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoListService.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoListService.java
@@ -13,7 +13,7 @@
import java.util.List;
-//tag::snippet[]
+// tag::snippet[]
@BrowserCallable
@AnonymousAllowed
public class ProductDtoListService implements ListService {
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java
index b3acb30ee3..32fafa60a3 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java
@@ -3,7 +3,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-//tag::snippet[]
+// tag::snippet[]
public interface ProductRepository extends JpaRepository,
JpaSpecificationExecutor {
}
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/ProductService.java b/src/main/java/com/vaadin/demo/fusion/crud/ProductService.java
index 4321952ee2..052638c73a 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/ProductService.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/ProductService.java
@@ -4,7 +4,7 @@
import com.vaadin.hilla.BrowserCallable;
import com.vaadin.hilla.crud.ListRepositoryService;
-//tag::snippet[]
+// tag::snippet[]
@BrowserCallable
@AnonymousAllowed
public class ProductService
diff --git a/src/main/java/com/vaadin/demo/fusion/crud/Supplier.java b/src/main/java/com/vaadin/demo/fusion/crud/Supplier.java
index 0e4cf138f0..5eb12d7830 100644
--- a/src/main/java/com/vaadin/demo/fusion/crud/Supplier.java
+++ b/src/main/java/com/vaadin/demo/fusion/crud/Supplier.java
@@ -5,7 +5,7 @@
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
-//tag::snippet[]
+// tag::snippet[]
@Entity
public class Supplier {
@Id