diff --git a/articles/components/auto-crud/index.adoc b/articles/components/auto-crud/index.adoc index 3c06376cd9..4edb986de2 100644 --- a/articles/components/auto-crud/index.adoc +++ b/articles/components/auto-crud/index.adoc @@ -25,17 +25,17 @@ Auto CRUD requires a Java service that implements the `CrudService` inter [.example] -- [source,java] -.EmployeeService.java +.`EmployeeService.java` ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/EmployeeService.java[tags=snippet,indent=0] ---- [source,java] -.Employee.java +.`Employee.java` ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Employee.java[tags=snippet,indent=0] ---- [source,java] -.EmployeeRepository.java +.`EmployeeRepository.java` ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/EmployeeRepository.java[tags=snippet,indent=0] ---- @@ -149,22 +149,22 @@ The following example shows a basic implementation of a custom `CrudService` tha [.example] -- -.ProductDtoCrudService.java +.`ProductDtoCrudService.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoCrudService.java[tags=snippet,indent=0] ---- -.ProductDto.java +.`ProductDto.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductDto.java[tags=snippet,indent=0] ---- -.Product.java +.`Product.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Product.java[tags=snippet,indent=0] ---- -.ProductRepository.java +.`ProductRepository.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java[tags=snippet,indent=0] diff --git a/articles/components/auto-form/index.adoc b/articles/components/auto-form/index.adoc index 3f3ed3a1f9..9ebea91879 100644 --- a/articles/components/auto-form/index.adoc +++ b/articles/components/auto-form/index.adoc @@ -25,17 +25,17 @@ Auto Form requires a Java service that implements the `CrudService` inter [.example] -- [source,java] -.EmployeeService.java +.`EmployeeService.java` ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/EmployeeService.java[tags=snippet,indent=0] ---- [source,java] -.Employee.java +.`Employee.java` ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Employee.java[tags=snippet,indent=0] ---- [source,java] -.EmployeeRepository.java +.`EmployeeRepository.java` ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/EmployeeRepository.java[tags=snippet,indent=0] ---- @@ -295,22 +295,22 @@ The following example shows a basic implementation of a custom `FormService` tha [.example] -- -.ProductDtoFormService.java +.`ProductDtoFormService.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoFormService.java[tags=snippet,indent=0] ---- -.ProductDto.java +.`ProductDto.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductDto.java[tags=snippet,indent=0] ---- -.Product.java +.`Product.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Product.java[tags=snippet,indent=0] ---- -.ProductRepository.java +.`ProductRepository.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java[tags=snippet,indent=0] diff --git a/articles/components/auto-grid/index.adoc b/articles/components/auto-grid/index.adoc index 9b215dc3ed..75ed94bafb 100644 --- a/articles/components/auto-grid/index.adoc +++ b/articles/components/auto-grid/index.adoc @@ -22,22 +22,22 @@ Auto Grid requires a Java service that implements the `ListService` interface [.example] -- -.ProductService.java +.`ProductService.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductService.java[tags=snippet,indent=0] ---- -.Product.java +.`Product.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Product.java[tags=snippet,indent=0] ---- -.Supplier.java +.`Supplier.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Supplier.java[tags=snippet,indent=0] ---- -.ProductRepository.java +.`ProductRepository.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java[tags=snippet,indent=0] @@ -275,22 +275,22 @@ The following example shows a basic implementation of a custom `ListService` tha [.example] -- -.ProductDtoListService.java +.`ProductDtoListService.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductDtoListService.java[tags=snippet,indent=0] ---- -.ProductDto.java +.`ProductDto.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductDto.java[tags=snippet,indent=0] ---- -.Product.java +.`Product.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Product.java[tags=snippet,indent=0] ---- -.ProductRepository.java +.`ProductRepository.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java[tags=snippet,indent=0] @@ -312,22 +312,22 @@ This example uses a [classname]`FilterTransformer` to adapt filtering and sortin [.example] -- -.ProductAdvancedDtoListService.java +.`ProductAdvancedDtoListService.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDtoListService.java[tags=snippet,indent=0] ---- -.ProductAdvancedDto.java +.`ProductAdvancedDto.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductAdvancedDto.java[tags=snippet,indent=0] ---- -.Product.java +.`Product.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/Product.java[tags=snippet,indent=0] ---- -.ProductRepository.java +.`ProductRepository.java` [source,java] ---- include::{root}/src/main/java/com/vaadin/demo/fusion/crud/ProductRepository.java[tags=snippet,indent=0] diff --git a/articles/flow/advanced/long-running-tasks.adoc b/articles/flow/advanced/long-running-tasks.adoc index 2b92a19644..031b827c69 100644 --- a/articles/flow/advanced/long-running-tasks.adoc +++ b/articles/flow/advanced/long-running-tasks.adoc @@ -25,7 +25,7 @@ The examples used here are based on Spring Boot, but a similar approach can be u To illustrate how a poorly designed handling of long-running tasks can affect users, consider the following backend service that simulates a long-running task. -.BackendService.java +.`BackendService.java` [source,java] ---- @Service @@ -46,7 +46,7 @@ public class BackendService { Consider also that the [methodname]`BackendService.longRunningTask()` method is being called from the following Vaadin UI: -.MainView.java +.`MainView.java` [source,java] ---- @Route("") @@ -84,7 +84,7 @@ When the asynchronous task is finished, Vaadin uses <<{articles}/flow/advanced/s The following example shows how the [methodname]`BackendService.longRunningTask()` method can be adjusted to run asynchronously in a separate thread. -.BackendService.java +.`BackendService.java` [source,java] ---- @Service @@ -115,7 +115,7 @@ With these changes in place, you can change the UI to allow the user to start th Vaadin can then use the [interfacename]`ListenableFuture` and the [methodname]`UI.access()` method of <<{articles}/flow/advanced/server-push#, Server Push>> to notify the user when the task is completed. This is how [filename]`MainView.java` could look now: -.MainView.java +.`MainView.java` [source,java] ---- @Route("") @@ -159,7 +159,7 @@ For the above example to work as intended, you need two extra annotations for th You can make both changes in the same class as illustrated in the following [classname]`Application` class (which both extends [classname]`SpringBootServletInitializer` and implements [interfacename]`AppShellConfigurator`): -.Application.java +.`Application.java` [source,java] ---- @SpringBootApplication @@ -179,7 +179,7 @@ public class Application extends SpringBootServletInitializer implements AppShel With the Vaadin component <<{articles}/components/progress-bar#, Progress Bar>>, you can provide an indicator that a long-running action is currently in progress. The following adjusts the above [classname]`MainView` example to show a progress bar when the user clicks the "Start long-running task" button. -.MainView.java +.`MainView.java` [source,java] ---- @Route("") @@ -238,7 +238,7 @@ For your task to be cancellable, the following conditions must be met: The modified [classname]`MainView` class below shows how to add a [classname]`Button` to cancel the long-running task. -.MainView.java +.`MainView.java` [source,java] ---- @Route("") diff --git a/articles/flow/advanced/servlet-container-authentication.adoc b/articles/flow/advanced/servlet-container-authentication.adoc index 62f9e9524f..397dda0c82 100644 --- a/articles/flow/advanced/servlet-container-authentication.adoc +++ b/articles/flow/advanced/servlet-container-authentication.adoc @@ -22,7 +22,7 @@ For customized authentication, you need to implement a custom [classname]`HttpSe The following example contains a customized [classname]`Principal` object. It's assumed that this principal is set as a [classname]`Session` attribute at some point by the application. -.CustomPrincipal.java +.`CustomPrincipal.java` [source,java] ---- public class CustomPrincipal implements Principal { @@ -44,7 +44,7 @@ public class CustomPrincipal implements Principal { } ---- -.CustomHttpServletRequest.java +.`CustomHttpServletRequest.java` [source,java] ---- public class CustomHttpServletRequest extends HttpServletRequestWrapper { @@ -67,7 +67,7 @@ public class CustomHttpServletRequest extends HttpServletRequestWrapper { } ---- -.CustomWebFilter.java +.`CustomWebFilter.java` [source,java] ---- @WebFilter("/connect") @@ -126,7 +126,7 @@ export class MyLogin extends LitElement { Next, change the above filter to handle the request and set the appropriate principal object in the session. -.CustomWebFilter.java +.`CustomWebFilter.java` [source,java] ---- @WebFilter("/connect") diff --git a/articles/flow/create-ui/creating-components/mixins.adoc b/articles/flow/create-ui/creating-components/mixins.adoc index 1f50cbdc9d..fdcf414bed 100644 --- a/articles/flow/create-ui/creating-components/mixins.adoc +++ b/articles/flow/create-ui/creating-components/mixins.adoc @@ -42,7 +42,7 @@ https://vaadin.com/api/platform/{moduleMavenVersion:com.vaadin:vaadin}/com/vaadi Were you to create a custom `Tooltip` component, for example, that implements the [interfacename]`HasComponents` and [interfacename]`HasStyle` interfaces, you would do something like this: -.Tooltip.java +.`Tooltip.java` [source,java] ---- @Tag("sample-tooltip") diff --git a/articles/flow/integrations/embedding/theming.adoc b/articles/flow/integrations/embedding/theming.adoc index 74765b4b45..d60878efb9 100644 --- a/articles/flow/integrations/embedding/theming.adoc +++ b/articles/flow/integrations/embedding/theming.adoc @@ -30,7 +30,7 @@ Both of these are also put into the head element for the embedded components, wh All other styles are only available inside the web component shadow root and don't reach the outlying context. -.MyExporter.java +.`MyExporter.java` [source,java] ---- @Theme(themeClass = Material.class) diff --git a/articles/flow/integrations/hilla.adoc b/articles/flow/integrations/hilla.adoc index 90d53fc2e4..0976fd4d71 100644 --- a/articles/flow/integrations/hilla.adoc +++ b/articles/flow/integrations/hilla.adoc @@ -76,7 +76,7 @@ Vaadin includes Hilla dependencies, so no dependency adjustment is needed. Add a view file, [filename]`HelloView.java`, to the `src/main/java/org/vaadin/example/HelloView.java` sub-directory. It'll be accessible under the path, `/hello` in a browser. Here's an example of that: -.HelloView.java +.`HelloView.java` [source,java] ---- import com.vaadin.flow.component.button.Button; @@ -112,7 +112,7 @@ When using Hilla's `createMenuItems()` utility function to build the main menu i The [annotationname]`@Menu` annotation should always be used together with the [annotationname]`@Route` annotation as in the following example: -.HelloView.java +.`HelloView.java` [source,java] ---- import com.vaadin.flow.component.orderedlayout.VerticalLayout; @@ -143,7 +143,7 @@ Mode is configurable with [interfacename]`MenuAccessControl` interface with the The following example changes the default mode to `NEVER` in a Spring Framework application: -.Application.java +.`Application.java` [source,java] ---- import org.springframework.boot.SpringApplication; @@ -171,7 +171,7 @@ public class Application { This next example changes the default mode to `NEVER` in a non-Spring application by using <<../configuration/properties.adoc#servlet-initialization-parameters,Servlet Initialization Parameters>> `menu.access.control` with value `org.vaadin.example.CustomMenuAccessControl`. [classname]`DefaultMenuAccessControl` implements [interfacename]`MenuAccessControl`: -.org.vaadin.example.CustomMenuAccessControl.java +.`org.vaadin.example.CustomMenuAccessControl.java` [source,java] ---- import com.vaadin.flow.server.auth.DefaultMenuAccessControl; diff --git a/articles/flow/testing/ui-unit/component-query.adoc b/articles/flow/testing/ui-unit/component-query.adoc index 826fd09acb..9399392045 100644 --- a/articles/flow/testing/ui-unit/component-query.adoc +++ b/articles/flow/testing/ui-unit/component-query.adoc @@ -136,7 +136,7 @@ public class PhoneNumberFieldTester extends ComponentTester { diff --git a/articles/flow/testing/ui-unit/getting-started.adoc b/articles/flow/testing/ui-unit/getting-started.adoc index f5c2c8a313..457f7754b0 100644 --- a/articles/flow/testing/ui-unit/getting-started.adoc +++ b/articles/flow/testing/ui-unit/getting-started.adoc @@ -166,7 +166,7 @@ The modality check only works when the modal component is <<{articles}/flow/adva Sample test of the HelloWorld view. -.HelloWorld.java +.`HelloWorld.java` [source,java] ---- @Route(value = "", layout = MainLayout.class) @@ -193,7 +193,7 @@ public class HelloWorldView extends HorizontalLayout { [NOTE] The components are package-protected, so that we can use them directly in the [classname]`UIUnitTest`. -.HelloWorldViewTest.java +.`HelloWorldViewTest.java` [source,java] ---- class HelloWorldViewTest extends UIUnitTest { diff --git a/articles/getting-started/tutorial/hilla/first-view.adoc b/articles/getting-started/tutorial/hilla/first-view.adoc index d9f549ba1c..016c9d7dbb 100644 --- a/articles/getting-started/tutorial/hilla/first-view.adoc +++ b/articles/getting-started/tutorial/hilla/first-view.adoc @@ -213,7 +213,7 @@ At this point, the application looks okay but it does not do anything. You are n Start by opening the [classname]`com.example.application.chat.ChatService` class in your IDE. Then add the [annotationname]`@BrowserCallable` annotation to the class, like this: -.ChatService.java +.`ChatService.java` [source,java] ---- package com.example.application.chat; @@ -233,7 +233,7 @@ public class ChatService { Because Hilla endpoints are protected by default, and you have not added security yet, you also need to add the [annotationname]`@AnonymousAllowed` annotation to the class so that you can test it: -.ChatService.java +.`ChatService.java` [source,java] ---- package com.example.application.chat; diff --git a/articles/hilla/guides/data-grids/index.adoc b/articles/hilla/guides/data-grids/index.adoc index 870c0deb4f..fe8d929d77 100644 --- a/articles/hilla/guides/data-grids/index.adoc +++ b/articles/hilla/guides/data-grids/index.adoc @@ -62,7 +62,7 @@ spring.jpa.hibernate.ddl-auto=update First, create a JPA entity class in the backend. For this guide, you'll use a simple entity that represents a product. Create a [filename]`Product.java` file next to [filename]`Application.java` with the following content: [source,java] -.Product.java +.`Product.java` ---- package com.example.application; @@ -128,7 +128,7 @@ public class Product { Next, create a Spring JPA repository for the entity. Create a [filename]`ProductRepository.java` file next to [filename]`Product.java` with the following content: [source,java] -.ProductRepository.java +.`ProductRepository.java` ---- package com.example.application; @@ -142,7 +142,7 @@ public interface ProductRepository extends JpaRepository, JpaSpec Finally, create a service to expose the repository to the frontend. Create a [filename]`ProductService.java` file next to `ProductRepository.java` with the following contents: [source,java] -.ProductService.java +.`ProductService.java` ---- package com.example.application; diff --git a/articles/hilla/lit/guides/forms/form-status-tracking.adoc b/articles/hilla/lit/guides/forms/form-status-tracking.adoc index f5297fec6c..3779a7d7b4 100644 --- a/articles/hilla/lit/guides/forms/form-status-tracking.adoc +++ b/articles/hilla/lit/guides/forms/form-status-tracking.adoc @@ -212,22 +212,22 @@ For a more complete example, open the following section. include::{root}{root-fix}/frontend/demo/fusion/forms/formchange/CompanyOfficeView.tsx[tags=snippet,indent=0] ---- [source,java] -.OfficeService.java +.`OfficeService.java` ---- include::{root}{root-fix}/src/main/java/com/vaadin/demo/fusion/forms/formchange/OfficeService.java[] ---- [source,java] -.CompanyOffice.java +.`CompanyOffice.java` ---- include::{root}{root-fix}/src/main/java/com/vaadin/demo/fusion/forms/formchange/CompanyOffice.java[] ---- [source,java] -.Country.java +.`Country.java` ---- include::{root}{root-fix}/src/main/java/com/vaadin/demo/fusion/forms/formchange/Country.java[] ---- [source,java] -.City.java +.`City.java` ---- include::{root}{root-fix}/src/main/java/com/vaadin/demo/fusion/forms/formchange/City.java[] ---- diff --git a/articles/hilla/tutorial/index.adoc b/articles/hilla/tutorial/index.adoc index fb4b8c3853..41202a5992 100644 --- a/articles/hilla/tutorial/index.adoc +++ b/articles/hilla/tutorial/index.adoc @@ -74,7 +74,7 @@ Hilla will automatically reload changes to frontend and backend code when saving Hilla makes it possible to call Java classes from TypeScript with the `@BrowserCallable` annotation. To do this, create a `CRMService.java` class in the `com.example.application.services` package. The service handles both listing and saving Contacts. Add the following code to the class: -.CRMService.java +.`CRMService.java` [source,java] ---- package com.example.application.services; diff --git a/articles/tools/dspublisher/editing.adoc b/articles/tools/dspublisher/editing.adoc index 2a711c0a44..ee5627a9d3 100644 --- a/articles/tools/dspublisher/editing.adoc +++ b/articles/tools/dspublisher/editing.adoc @@ -250,7 +250,7 @@ By default, the source code language is used as the title of the block. You can [example] ==== -.MyButtonExample.java +.`MyButtonExample.java` [source,java] ---- Button button = new Button("My Button"); @@ -260,7 +260,7 @@ Button button = new Button("My Button"); [source,asciidoc] ----- // tag::snippet[] -.MyButtonExample.java +.`MyButtonExample.java` // end::snippet[] [source,java] ---- @@ -279,15 +279,15 @@ You can combine multiple code examples together if you specify them inside an `. ==== [.example] -- -.VirtualListExample.java +.`VirtualListExample.java` [source,java] ---- -List people = DataService.getPeople(); // See Person.java +List people = DataService.`getPeople(); // See Person.java` VirtualList list = new VirtualList<>(); list.setItems(people); ---- -.Person.java +.`Person.java` [source,java] ---- public class Person { @@ -295,7 +295,7 @@ public class Person { } ---- -.Address.java +.`Address.java` [source,java] ---- public class Address { @@ -309,15 +309,15 @@ public class Address { ----- [.example] -- -.VirtualListExample.java +.`VirtualListExample.java` [source,java] ---- -List people = DataService.getPeople(); // See Person.java +List people = DataService.`getPeople(); // See Person.java` VirtualList list = new VirtualList<>(); list.setItems(people); ---- -.Person.java +.`Person.java` [source,java] ---- public class Person { @@ -325,7 +325,7 @@ public class Person { } ---- -.Address.java +.`Address.java` [source,java] ---- public class Address { @@ -475,7 +475,7 @@ Part of the source code can be entirely omitted from the rendered code examples [example] ==== -.MyComponentExample.java +.`MyComponentExample.java` [source,java] ---- // The following line isn't shown @@ -488,7 +488,7 @@ public MyComponentExample() { [.example] -- -.MyComponentExample.java +.`MyComponentExample.java` [source,java] ---- // The following line isn't shown