RapidPM Vaadin Fluent Component API - Vaadin Add-on Directory
the missing Fluent API for Vaadin 10 Components
[![](https://jitpack.io/v/vaadin-developer/fluent-api-for-flow.svg)](https://jitpack.io/#vaadin-developer/fluent-api-for-flow)
[![](https://jitci.com/gh/vaadin-developer/fluent-api-for-flow/svg)](https://jitci.com/gh/vaadin-developer/fluent-api-for-flow)
A Fluent API based on a Builder Pattern to make sure that the original classes are not touched.
Usable for existing and new projects. Mixed mode with other init structures are possible.
>
> the long version to read
> you can find here [Tutorial](https://vaadin.com/tutorials/flow-java-api-fluent)
>
```java
private final PasswordField password
= new PasswordFieldBuilder(PasswordField::new)
.setId("pf-password-id")
.setPlaceholder("password")
.build();
```
If you have an instance already, you can use this one as well.
Working with typed Composites will give you an already created instance of
the type that is used inside the declaration.
The demo app ist using a ```Composite``` as base.
The method **getContent()** will give you exactly this instance.
To configure the instance, use this on as input for the Builder.
```java
public LoginView() {
new HorizontalLayoutBuilder(ofNullable(getContent()))
.setDefaultVerticalComponentAlignment(Alignment.CENTER)
.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER)
.setSizeFull()
.component()
.ifPresent(l -> l.add(layout));
}
```
This Add on is under active development.
If you need some features, or more wrapped Components.... let me know
You can reach me under my email or via Twitter (@SvenRuppert)
Happy coding