Vaadin 8 | AppLayoutBuilder - appreciated/vaadin-app-layout GitHub Wiki

The AppLayout is meant to be built via the com.github.appreciated.app.layout.builder.AppLayoutBuilder while the AppLayout itself is only meant to contain the resulting Components.

Basic Usage

Receiving a Builder

To receive a Builder you need to specify one of the Available Behaviors.

AppLayoutBuilder::get(Behaviour behaviour)

Set the Title

To set the title use the following method.

AppLayoutBuilder::withTitle(String title)

Set the Design

To specify set one of the Available Designs.

AppLayoutBuilder::withDesign(AppBarDesign design)

Add Views to the Menu

When adding Views you actually want to navigate to the AppLayout makes it easier for you to use the Vaadin Navigator.

AppLayoutBuilder::add(String caption, Resource icon, Class<? extends View> element)

Add Components to the Menu

To add a plain Component which you manage yourself simply do

AppLayoutBuilder::add(Component component)

Add Menu Entries with a Click Action to the Menu

To add a Navigation Element without an actual View but with a Click Event simply do as follows

AppLayoutBuilder::addClickable(String caption, Resource icon, Button.ClickListener listener)

Set the Default Navigation View

To set the default navigation View. Note: This won't work at all when using CDI.

AppLayoutBuilder::withDefaultNavigationView(View view)

Advanced Usage

Receiving a Builder

Also you can pass the builder your own AppLayout implementation

AppLayoutBuilder.get(AppLayout appLayout)