Skip to content

Commit b9ac31d

Browse files
authored
chore: remove trailing whitespaces (#5042)
1 parent d1138d1 commit b9ac31d

116 files changed

Lines changed: 407 additions & 407 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/styles/Vaadin/CrossReference.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends: existence
22
message: "Don't use absolute URLs for cross references within documentation."
33
link: https://vaadin.com/docs/contributing/docs/styleguide/#xrefs
44
nonword: true
5-
level: error
5+
level: error
66
scope: raw
77
ignorecase: true
88
# The only accepted case is 'link:/docs/...' which can be used to link across documentation versions

articles/building-apps/ai/quickstart-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ section-nav: badge-flow
88
---
99

1010

11-
= Quick Start-Guide: Add an AI Chat Bot to a Vaadin + Spring Boot Application [badge-flow]#Flow#
11+
= Quick Start-Guide: Add an AI Chat Bot to a Vaadin + Spring Boot Application [badge-flow]#Flow#
1212

1313
This guide shows how to connect a Large Language Model (LLM) into a Vaadin application using Spring AI and Spring Boot. You'll build a minimal chat UI with Vaadin provided components **MessageList** and **MessageInput**, stream responses token-by-token, and keep a conversational tone in the dialog with the AI.
1414

articles/building-apps/architecture/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ order: 100
77
section-nav: badge-deep-dive
88
---
99

10-
= Architecture [badge-deep-dive]#Deep Dive#
10+
= Architecture [badge-deep-dive]#Deep Dive#
1111

1212
.Deep Dive - Recommended Approach
1313
[IMPORTANT]

articles/building-apps/architecture/packages.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ When you package by layer, you put all classes that belong to the same architect
3636

3737
This paradigm groups classes with similar responsibilities together. This leads to a *clear separation of concerns*. A class with too many responsibilities doesn't fit into any of the packages. This gives a natural inclination to split the class into smaller parts.
3838

39-
One drawback of this approach is that most classes need to be public. This means classes across layers can directly access each other, potentially violating architectural boundaries. However, the architectural style often dictates a specific dependency flow, such as `ui` -> `service` -> `domain`. You'd have to use something like https://www.archunit.org/[ArchUnit] to ensure the dependencies between classes are according to your architectural style, or put each layer into a <<project-structure/multi-module#,separate JAR file>>. Public visibility also makes it more difficult to separate <<api-spi#,APIs and SPIs>> from internal classes.
39+
One drawback of this approach is that most classes need to be public. This means classes across layers can directly access each other, potentially violating architectural boundaries. However, the architectural style often dictates a specific dependency flow, such as `ui` -> `service` -> `domain`. You'd have to use something like https://www.archunit.org/[ArchUnit] to ensure the dependencies between classes are according to your architectural style, or put each layer into a <<project-structure/multi-module#,separate JAR file>>. Public visibility also makes it more difficult to separate <<api-spi#,APIs and SPIs>> from internal classes.
4040

4141
Another drawback is that feature cohesion suffers. In the example above, all Customer-related code is spread across multiple packages, making it harder to understand the complete feature. This also has an impact on testing: you can't easily mock or isolate a complete feature. You often end up testing dependencies across multiple layers rather than testing a cohesive feature in isolation.
4242

@@ -66,7 +66,7 @@ When you package by feature, you put all classes that implement the same feature
6666
├── com.example.application.util
6767
│ └── + StringUtils
6868
└── com.example.application
69-
└── + Application
69+
└── + Application
7070
----
7171

7272
Compared to package by layer, this leads to higher feature cohesion and modularity. The classes that implement the same feature or functionality are grouped together. If you need to make a change to a feature, you only need to touch one package. Your tests can focus on one feature and test it in isolation. And if you need to split your application into modules or microservices, you can do that.
@@ -98,7 +98,7 @@ com.example.application
9898
├── Application
9999
├── CustomerDTO
100100
├── CustomerRestClient
101-
└── CustomerView
101+
└── CustomerView
102102
----
103103

104104
=== Layers Inside Features
@@ -117,7 +117,7 @@ Features can grow quite big, which introduces the risk of the code inside the fe
117117
│ ├── - CustomerForm
118118
│ └── - CustomerView
119119
└── com.example.application
120-
└── + Application
120+
└── + Application
121121
----
122122

123123
Now, the UI-related classes is in a separate `ui` package. The classes can have package visibility since they are only called by the web browser, not by other feature packages. They call the API of the root feature package, which has public visibility.
@@ -136,7 +136,7 @@ If you use JPA inheritance and end up moving some entities into a separate appli
136136

137137
== Final Thoughts
138138

139-
Package structure plays a big role in the readability and maintainability of your application. You know your package structure is right when you find classes where you expected them to be, and have no problems deciding where to put new classes.
139+
Package structure plays a big role in the readability and maintainability of your application. You know your package structure is right when you find classes where you expected them to be, and have no problems deciding where to put new classes.
140140

141141
When you package by layer, classes that belong to the same architectural layer (like "UI", "Service", "Domain") end up in the same package. When you package by feature, classes that belong to the same feature (like "Customer Onboarding", "Dashboard", "Order Processing") end up in the same package.
142142

articles/building-apps/architecture/project-structure/index.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Whenever you build a web application with Spring Boot, you have to decide whethe
2323

2424
=== JAR File Packaging
2525

26-
Packaging a Vaadin application as a JAR file is the recommended choice. It contains everything needed to run an application, except for the Java Virtual Machine. The web server -- like https://tomcat.apache.org/[Tomcat], https://jetty.org/index.html[Jetty], or https://undertow.io/[Undertow] -- is embedded. Therefore, you can start an application by running this command:
26+
Packaging a Vaadin application as a JAR file is the recommended choice. It contains everything needed to run an application, except for the Java Virtual Machine. The web server -- like https://tomcat.apache.org/[Tomcat], https://jetty.org/index.html[Jetty], or https://undertow.io/[Undertow] -- is embedded. Therefore, you can start an application by running this command:
2727

2828
[source,terminal]
2929
----
@@ -37,7 +37,7 @@ This makes the deployment simple and with a few options. To deploy an applicatio
3737

3838
// TODO Mention GraalVM
3939

40-
Another advantage to packaging an application as a JAR file is that it'll run inside its own Java Virtual Machine, and therefore its own operating system process. This allow you to configure and restart it without affecting other applications. Plus, if the application is compromised or crashes, other applications running on the same physical server are better protected since they run in their own processes. This feature, though, comes with a cost.
40+
Another advantage to packaging an application as a JAR file is that it'll run inside its own Java Virtual Machine, and therefore its own operating system process. This allow you to configure and restart it without affecting other applications. Plus, if the application is compromised or crashes, other applications running on the same physical server are better protected since they run in their own processes. This feature, though, comes with a cost.
4141

4242
Since every application runs an embedded web server, they consume more memory and disk space than a traditional Java web application. However, since memory and disk space are quite cheap, the cost is usually well worth the benefits.
4343

@@ -53,6 +53,6 @@ You should only consider WAR packaging if you already have a web application ser
5353

5454
== Multi vs. Single-Module
5555

56-
You can build your Vaadin applications as single-module Maven projects, or as multi-module Maven projects. Both options have advantages and disadvantages. You should familiarize yourself with them before making a decision.
56+
You can build your Vaadin applications as single-module Maven projects, or as multi-module Maven projects. Both options have advantages and disadvantages. You should familiarize yourself with them before making a decision.
5757

5858
You can find more information on the <<single-module#,Single-Module Projects>>, and the <<multi-module#,Multi-Module Projects>> documentation pages.

articles/building-apps/architecture/project-structure/multi-module.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include::{articles}/_vaadin-version.adoc[]
1111

1212
= Multi-Module Projects
1313

14-
A multi-module project consists of multiple directories, each with its own POM file and source directory. The modules can depend on each other; Maven builds them in the correct order.
14+
A multi-module project consists of multiple directories, each with its own POM file and source directory. The modules can depend on each other; Maven builds them in the correct order.
1515

1616
[IMPORTANT]
1717
Even though the project consists of many modules, it is still a single application and is packaged into a single JAR file or WAR file.
@@ -92,7 +92,7 @@ To be able to use basic Spring features such as dependency injection, all module
9292
<dependency>
9393
<groupId>org.springframework</groupId>
9494
<artifactId>spring-context</artifactId>
95-
</dependency>
95+
</dependency>
9696
</dependencies>
9797
----
9898

@@ -148,7 +148,7 @@ Below is how a fully configured POM file for an empty multi-module Vaadin applic
148148
<dependency>
149149
<groupId>org.springframework</groupId>
150150
<artifactId>spring-context</artifactId>
151-
</dependency>
151+
</dependency>
152152
</dependencies>
153153
154154
<modules>
@@ -364,11 +364,11 @@ You'll need to add the Vaadin Maven plugin somewhere in your multi-module projec
364364
</plugins>
365365
</build>
366366
</profile>
367-
</profiles>
367+
</profiles>
368368
</project>
369369
----
370370

371-
Store frontend sources, such as CSS files and JavaScript, in the `src/main/frontend` directory of the UI module. Store other resources, such as images, in `src/main/resources/META-INF/resources`.
371+
Store frontend sources, such as CSS files and JavaScript, in the `src/main/frontend` directory of the UI module. Store other resources, such as images, in `src/main/resources/META-INF/resources`.
372372

373373

374374
=== Multiple UI Modules
@@ -420,7 +420,7 @@ The application module is an ordinary Maven module that contains at least the `A
420420
<groupId>${project.groupId}</groupId>
421421
<artifactId>util</artifactId>
422422
<version>${project.version}</version>
423-
</dependency>
423+
</dependency>
424424
</dependencies>
425425
426426
<build>
@@ -472,7 +472,7 @@ If you're using package by feature, the POM-file would also include the Vaadin M
472472
<groupId>${project.groupId}</groupId>
473473
<artifactId>shopping-cart</artifactId>
474474
<version>${project.version}</version>
475-
</dependency>
475+
</dependency>
476476
</dependencies>
477477
478478
<build>
@@ -492,7 +492,7 @@ If you're using package by feature, the POM-file would also include the Vaadin M
492492
</goals>
493493
</execution>
494494
</executions>
495-
</plugin>
495+
</plugin>
496496
</plugins>
497497
</build>
498498
@@ -529,7 +529,7 @@ If you're using package by feature, the POM-file would also include the Vaadin M
529529
</plugins>
530530
</build>
531531
</profile>
532-
</profiles>
532+
</profiles>
533533
</project>
534534
----
535535

articles/building-apps/architecture/project-structure/single-module.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ Next, to build your project, you'll need to add two more Maven plugins:
123123

124124
The `spring-boot-maven-plugin` does plenty, but for now think of it as the plugin that packages a project into a single, executable JAR file. For more information about this plugin, see the https://docs.spring.io/spring-boot/maven-plugin[Spring Boot documentation].
125125

126-
The `vaadin-maven-plugin` also does plenty. The `prepare-frontend` goal checks that you have sufficiently recent versions of the `node` and `npm` tools. It installs them if they're missing. It also reviews all of the resources used by the application, generates some missing source files, and moves them into the correct locations.
126+
The `vaadin-maven-plugin` also does plenty. The `prepare-frontend` goal checks that you have sufficiently recent versions of the `node` and `npm` tools. It installs them if they're missing. It also reviews all of the resources used by the application, generates some missing source files, and moves them into the correct locations.
127127

128128
Depending on how much the plugin has to do, the first execution of this goal may take some time. However, later executions are often fast. Therefore, include this goal in every build. For more information, see <<{articles}/flow/production/production-build#,Production Build>> and <<{articles}/flow/configuration/maven#,Maven Configuration Properties>>.
129129

130-
After you've executed `prepare-frontend`, you're ready to run your application in <<{articles}/flow/configuration/development-mode#,development mode>>.
130+
After you've executed `prepare-frontend`, you're ready to run your application in <<{articles}/flow/configuration/development-mode#,development mode>>.
131131

132132

133133
== Production Build Profile

articles/building-apps/business-logic/add-service.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Add a Service
3-
page-title: How to add an application service to a Vaadin application
3+
page-title: How to add an application service to a Vaadin application
44
description: Learn how to add an application service to a Vaadin application.
55
meta-description: Learn how to design and implement application services in Vaadin. This guide covers best practices, security, naming conventions, and calling services from Vaadin views.
66
order: 5
@@ -14,13 +14,13 @@ In a Vaadin application, the _application layer_ contains the business, the data
1414

1515
image::images/application-layer-api.png[A diagram of the UI layer calling the application layer through an API]
1616

17-
This API is implemented by _application services_. In practice, application services are *Spring beans* that you can call from Vaadin views.
17+
This API is implemented by _application services_. In practice, application services are *Spring beans* that you can call from Vaadin views.
1818

1919

2020
== Design Guidelines
2121

2222
You can design application services according to your preferred architectural style, but following these best practices helps prevent common issues:
23-
23+
2424
* The application services should have *high cohesion*. This means that all the methods in your service should relate to the same thing.
2525
* The application services should be *stateless*.
2626
* Application services should *initiate and complete <<../forms-data/consistency/transactions#,database transactions>>* before returning results.
@@ -43,8 +43,8 @@ public class OrderCreationService {
4343
private final OrderRepository orderRepository;
4444
private final ApplicationEventPublisher eventPublisher;
4545
46-
OrderCreationService(Validator validator,
47-
OrderRepository orderRepository,
46+
OrderCreationService(Validator validator,
47+
OrderRepository orderRepository,
4848
ApplicationEventPublisher eventPublisher) {
4949
this.validator = validator;
5050
this.orderRepository = orderRepository;
@@ -58,7 +58,7 @@ public class OrderCreationService {
5858
throw new ConstraintViolationException(validationErrors);
5959
}
6060
var order = orderRepository.saveAndFlush(createOrderFromForm(orderForm));
61-
eventPublisher.publishEvent(new OrderCreatedEvent(order)); // Notify other
61+
eventPublisher.publishEvent(new OrderCreatedEvent(order)); // Notify other
6262
// components of
6363
// the new order
6464
return order.orderId();
@@ -247,7 +247,7 @@ public class CustomerOnboardingView extends Main {
247247
// end::snippet[]
248248
add(createCustomerBtn);
249249
}
250-
250+
251251
private void createCustomer() {
252252
// tag::snippet[]
253253
try {

articles/building-apps/business-logic/background-jobs/index.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ order: 35
88
---
99

1010

11-
= Background Jobs [badge-deep-dive]#Deep Dive#
11+
= Background Jobs [badge-deep-dive]#Deep Dive#
1212

1313
Many business applications need to perform in background threads. These tasks might be long-running operations triggered by the user, or scheduled jobs that run at specific times or intervals.
1414

@@ -42,7 +42,7 @@ To use virtual threads, you can enable them by setting the `spring.threads.virtu
4242

4343
You can interact with the `TaskExecutor` either directly, or declaratively through annotations.
4444

45-
When interacting with it directly, you would inject an instance of `TaskExecutor` into your code, and submit work to it.
45+
When interacting with it directly, you would inject an instance of `TaskExecutor` into your code, and submit work to it.
4646

4747
Here is an example of a class that uses the `TaskExecutor`:
4848

@@ -70,7 +70,7 @@ public class MyWorker {
7070
[IMPORTANT]
7171
When you inject the `TaskExecutor`, you have to name the parameter `taskExecutor`. The application context may contain more than one bean that implements the `TaskExecutor` interface. If the parameter name doesn't match the name of the bean, Spring doesn't know which instance to inject.
7272

73-
If you want to use annotations, you have to enable them first. Do this by adding the `@EnableAsync` annotation to your main application class, or any other `@Configuration` class.
73+
If you want to use annotations, you have to enable them first. Do this by adding the `@EnableAsync` annotation to your main application class, or any other `@Configuration` class.
7474

7575
Here's an example that adds the annotation to the main application class:
7676

articles/building-apps/business-logic/background-jobs/interaction/callbacks.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Callbacks
3-
page-title: How to use callbacks to interact with your UI | Vaadin
3+
page-title: How to use callbacks to interact with your UI | Vaadin
44
description: How to use callbacks to interact with the user interface.
55
meta-description: When using a Flow user interface, the simplest way of allowing background jobs to interact with it is through callbacks. Learn more here.
66
order: 10
77
section-nav: badge-flow
88
---
99

1010

11-
= Callbacks [badge-flow]#Flow#
11+
= Callbacks [badge-flow]#Flow#
1212

1313
When using a Flow user interface, the simplest way of allowing background jobs to interact with it is through callbacks. You can use `Consumer`, `Runnable`, and `Supplier` as callback interfaces, depending on how you want to interact with the background job.
1414

@@ -41,7 +41,7 @@ A background job that returns a string or an exception could be implemented like
4141
[source,java]
4242
----
4343
@Async
44-
public void startBackgroundJob(Consumer<String> onComplete,
44+
public void startBackgroundJob(Consumer<String> onComplete,
4545
Consumer<Exception> onError) {
4646
try {
4747
var result = doSomethingThatTakesALongTime();
@@ -60,8 +60,8 @@ When the background job is also reporting its progress, for instance as a percen
6060
[source,java]
6161
----
6262
@Async
63-
public void startBackgroundJob(Consumer<String> onComplete,
64-
Consumer<Double> onProgress,
63+
public void startBackgroundJob(Consumer<String> onComplete,
64+
Consumer<Double> onProgress,
6565
Consumer<Exception> onError) {
6666
try {
6767
onProgress.apply(0.0);
@@ -93,8 +93,8 @@ A job can be cancelled. To do that, it would look like this:
9393
[source,java]
9494
----
9595
@Async
96-
public void startBackgroundJob(Consumer<String> onComplete,
97-
Consumer<Double> onProgress,
96+
public void startBackgroundJob(Consumer<String> onComplete,
97+
Consumer<Double> onProgress,
9898
Consumer<Exception> onError,
9999
Supplier<Boolean> isCancelled) {
100100
try {
@@ -150,7 +150,7 @@ Next, implement the service method like this:
150150

151151
[source,java]
152152
----
153-
public CancellableJob startBackgroundJob(Consumer<String> onComplete,
153+
public CancellableJob startBackgroundJob(Consumer<String> onComplete,
154154
Consumer<Double> onProgress
155155
Consumer<Exception> onError) {
156156
var cancelled = new AtomicBoolean(false);

0 commit comments

Comments
 (0)