FlexLayout Add-on
Java API for CSS Flexbox
FlexLayout is a UI component add-on for Vaadin 8. This add-on brings the configuration of CSS Flexbox to Java.
There's a handy builder style API for creating FlexLayout for all needs, for example you can make a vertical layout that wraps into columns with the following example code:
FlexLayout.create().vertical().wrap().alignItems().center().build();
The items in the columns will be horizontally in the middle if the column.
This add-on is implemented without the need for widgetset changes. It can be imported to a project without the need for client-side compilation.
Sample code
String[] testLabels = { "Test ", "Test String ", "Foo ", "Bar " }; FlexLayout columnLayout = FlexLayout.create().vertical().wrap() .alignItems().baseline().build(); columnLayout.setSizeFull(); IntStream.range(0, 100).boxed().map(i -> testLabels[i % 4] + i) .map(Label::new).forEach(columnLayout::addComponent);
FlexLayout tagLayout = new FlexLayout(); tagLayout.setFlexDirection(FlexDirection.Row); tagLayout.setFlexWrap(FlexWrap.Wrap); tagLayout.setAlignContent(AlignContent.FlexStart); tagLayout.setWidth("400px"); tagLayout.setHeight("100%"); Stream.of("HTML", "CSS", "JavaScript", "Java", "Vaadin", "Undertow", "Internet Explorer", "Chrome", "Firefox", "Safari") .map(caption -> { Button button = new Button(caption); button.addStyleName(ValoTheme.BUTTON_LINK); button.addClickListener( e -> tagLayout.removeComponent(button)); return button; }).forEach(tagLayout::addComponent);
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
- Released
- 2018-01-26
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 8.0+
- Browser
- Firefox
- Safari
- Google Chrome
- Android Browser
- Internet Explorer
- Microsoft Edge
Wizards for Vaadin - Vaadin Add-on Directory
Simple way to create multi-step wizardsIssue Tracker
Source Code
Online Demo
Discussion Forum
Manual
Wizards for Vaadin version 0.1.0
First public release.
Wizards for Vaadin version 0.2.0
Fixed an issue with wrapping step captions in the default progress bar.
Renamed Wizard.isCurrentStep method to Wizard.isActive.
Added Wizard.setHeader(Component) method to provide the header instead of always using the default progress bar.
Removed WizardCompletedListener in favor of a more generic WizardProgressListener.
Added more Javadocs.
Updated demo application accordingly.
Wizards for Vaadin version 0.3.0
Added Cancel button with corresponding getter method and lifecycle event (see WizardCancelledEvent).
Finish button is now disabled instead of hidden when the user is not yet in the last step.
Wizards for Vaadin version 0.4.0
Option for URI fragment navigation, setUriFragmentEnabled(boolean).
Wizard now extends CustomComponent instead of VerticalLayout.
Exposed next(), back(), finish() and cancel() methods on the public API
of Wizard.
WizardProgressBar is now displayed as the header by default.
Wizards for Vaadin version 0.4.1
Added API for step removal.
Wizards for Vaadin version 0.4.2
UriFragmentUtility is now lazily initialized.
Changed maturity from experimental to beta.
Wizards for Vaadin version 0.4.4
Fixed a bug with duplicate step identifiers.
Changed some fields and methods of Wizard class from private to protected for extension.
Wizards for Vaadin version 0.4.5
Renamed styles.css to avoid filename collisions.
Moved project hosting to GitHub (see the links on the sidebar).
Wizards for Vaadin version 1.0.0-beta1
First version for Vaadin 7.
Widgetset compilation no longer required, as the add-on is completely server-side.
Wizards for Vaadin version 1.0.1
• Wizard now remembers scroll positions and scrolls to top when activating a step for the first time.
• Project is now built with Maven.
* Notice that version 1.0.0 was the same as this one, but had issues with the add-on packaging.
Wizards for Vaadin version 1.0.2
Fix for Maven packaging.
Wizards for Vaadin version 1.1.0
• Replaced ProgressIndicator with ProgressBar to eliminate unnecessary polling requests.
• Support for Vaadin 7.1+
Wizards for Vaadin version 1.1.1
Minor CSS update on the progress bar style.
Wizards for Vaadin version 2.0.0
First version supporting Vaadin 8 via the compatibility package
Wizards for Vaadin version 2.0.1
Support Vaadin 8 without compatibility package