RapidPM Vaadin Fluent Component API
the missing Fluent API for Vaadin 10 Components
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
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<HorizontalLayout>
as base.
The method getContent() will give you exactly this instance.
To configure the instance, use this on as input for the Builder.
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
Sample code
private final PasswordField password = new PasswordFieldBuilder(PasswordField::new) .setId("pf-password-id") .setPlaceholder("password") .build();
public LoginView() { new HorizontalLayoutBuilder(ofNullable(getContent())) .setDefaultVerticalComponentAlignment(Alignment.CENTER) .setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER) .setSizeFull() .component() .ifPresent(l -> l.add(layout)); }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Fluent API for Flow
The description is available under https://vaadin.com/tutorials/flow-java-api-fluent
Available with complete method signatures
- Vaadin Button
- Vaadin Checkbox
- Vaadin Ordered Layout - Horizontal / Vertical
- Vaadin Text Field - Text / Password
- Vaadin Combo Box
- Vaadin Context Menu
Available via generic interfaces
Vaadin Accordion
Vaadin Date Picker
Vaadin Time Picker
Vaadin Details
Vaadin Dialog
Vaadin Select
Vaadin Form Layout
Vaadin Grid
Vaadin Icons
Vaadin Item
Vaadin List Box
Vaadin Notification
Vaadin Progress Bar
Vaadin Radio Button
Vaadin Split Layout
Vaadin Tabs
Vaadin Upload
Vaadin Custom Field
Vaadin App Layout
Vaadin Login
Vaadin Board
Vaadin Charts
Vaadin Confirm Dialog
Vaadin Cookie Consent
Vaadin Crud
Vaadin Grid Pro
Vaadin Rich Text Editor
- Released
- 2019-04-16
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 10+
- Browser
- Browser Independent