Search in sources :

Example 1 with DefaultViewNameInterceptor

use of com.github.appreciated.app.layout.interceptor.DefaultViewNameInterceptor in project vaadin-app-layout by appreciated.

the class DemoUI method setDrawerVariant.

private void setDrawerVariant(Behaviour variant) {
    holder.removeAllComponents();
    AppLayoutComponent drawer = AppLayout.getDefaultBuilder(variant).withTitle("App Layout").addToAppBar(new AppBarNotificationButton(notifications, true)).withViewNameInterceptor(new DefaultViewNameInterceptor()).withDefaultNavigationView(View1.class).withDesign(AppLayoutDesign.MATERIAL).add(new MenuHeader("Version 0.9.21", new ThemeResource("logo.png")), HEADER).addClickable("Set Behaviour HEADER", VaadinIcons.COG, clickEvent -> openModeSelector(variant), HEADER).add("Home", VaadinIcons.HOME, badge, new View1()).add(SubmenuBuilder.get("My Submenu", VaadinIcons.PLUS).add(SubmenuBuilder.get("My Submenu", VaadinIcons.PLUS).add("Charts3", VaadinIcons.SPLINE_CHART, View2.class).add("Contact3", VaadinIcons.CONNECT, View3.class).add("More3", VaadinIcons.COG, View4.class).build()).add("Contact1", VaadinIcons.CONNECT, View3.class).add("More1", VaadinIcons.COG, View4.class).build()).add(SubmenuBuilder.get("My Submenu", VaadinIcons.PLUS).add(SubmenuBuilder.get("My Submenu", VaadinIcons.PLUS).add("Charts4", VaadinIcons.SPLINE_CHART, View2.class).add("Contact4", VaadinIcons.CONNECT, View3.class).add("More4", VaadinIcons.COG, View4.class).build()).add("Contact2", VaadinIcons.CONNECT, View3.class).add("More2", VaadinIcons.COG, View4.class).build()).add("Menu", VaadinIcons.MENU, View5.class).add("Elements", VaadinIcons.LIST, ElementsView.class).addClickable("Set Behaviour FOOTER", VaadinIcons.COG, clickEvent -> openModeSelector(variant), FOOTER).build();
    drawer.addStyleName("left");
    holder.addComponent(drawer);
    if (getNavigator() != null) {
        getNavigator().navigateTo("");
    }
    reloadNotifications();
}
Also used : ThemeResource(com.vaadin.server.ThemeResource) FOOTER(com.github.appreciated.app.layout.builder.Section.FOOTER) SubmenuBuilder(com.github.appreciated.app.layout.builder.elements.builders.SubmenuBuilder) Behaviour(com.github.appreciated.app.layout.behaviour.Behaviour) VaadinRequest(com.vaadin.server.VaadinRequest) VaadinServlet(com.vaadin.server.VaadinServlet) Transport(com.vaadin.shared.ui.ui.Transport) VaadinIcons(com.vaadin.icons.VaadinIcons) DefaultViewNameInterceptor(com.github.appreciated.app.layout.interceptor.DefaultViewNameInterceptor) AppBarNotificationButton(com.github.appreciated.app.layout.component.button.AppBarNotificationButton) ValoTheme(com.vaadin.ui.themes.ValoTheme) MEDIUM(com.github.appreciated.app.layout.builder.entities.DefaultNotification.Priority.MEDIUM) AppLayoutDesign(com.github.appreciated.app.layout.builder.design.AppLayoutDesign) HEADER(com.github.appreciated.app.layout.builder.Section.HEADER) DefaultNotificationHolder(com.github.appreciated.app.layout.builder.entities.DefaultNotificationHolder) PushStateNavigation(com.vaadin.navigator.PushStateNavigation) DefaultNotification(com.github.appreciated.app.layout.builder.entities.DefaultNotification) WebServlet(javax.servlet.annotation.WebServlet) Consumer(java.util.function.Consumer) AppLayoutComponent(com.github.appreciated.app.layout.behaviour.AppLayoutComponent) com.vaadin.annotations(com.vaadin.annotations) MenuHeader(com.github.appreciated.app.layout.component.MenuHeader) DefaultBadgeHolder(com.github.appreciated.app.layout.builder.entities.DefaultBadgeHolder) AppLayout(com.github.appreciated.app.layout.AppLayout) View(com.vaadin.navigator.View) com.vaadin.ui(com.vaadin.ui) MenuHeader(com.github.appreciated.app.layout.component.MenuHeader) ThemeResource(com.vaadin.server.ThemeResource) DefaultViewNameInterceptor(com.github.appreciated.app.layout.interceptor.DefaultViewNameInterceptor) AppBarNotificationButton(com.github.appreciated.app.layout.component.button.AppBarNotificationButton) AppLayoutComponent(com.github.appreciated.app.layout.behaviour.AppLayoutComponent)

Aggregations

AppLayout (com.github.appreciated.app.layout.AppLayout)1 AppLayoutComponent (com.github.appreciated.app.layout.behaviour.AppLayoutComponent)1 Behaviour (com.github.appreciated.app.layout.behaviour.Behaviour)1 FOOTER (com.github.appreciated.app.layout.builder.Section.FOOTER)1 HEADER (com.github.appreciated.app.layout.builder.Section.HEADER)1 AppLayoutDesign (com.github.appreciated.app.layout.builder.design.AppLayoutDesign)1 SubmenuBuilder (com.github.appreciated.app.layout.builder.elements.builders.SubmenuBuilder)1 DefaultBadgeHolder (com.github.appreciated.app.layout.builder.entities.DefaultBadgeHolder)1 DefaultNotification (com.github.appreciated.app.layout.builder.entities.DefaultNotification)1 MEDIUM (com.github.appreciated.app.layout.builder.entities.DefaultNotification.Priority.MEDIUM)1 DefaultNotificationHolder (com.github.appreciated.app.layout.builder.entities.DefaultNotificationHolder)1 MenuHeader (com.github.appreciated.app.layout.component.MenuHeader)1 AppBarNotificationButton (com.github.appreciated.app.layout.component.button.AppBarNotificationButton)1 DefaultViewNameInterceptor (com.github.appreciated.app.layout.interceptor.DefaultViewNameInterceptor)1 com.vaadin.annotations (com.vaadin.annotations)1 VaadinIcons (com.vaadin.icons.VaadinIcons)1 PushStateNavigation (com.vaadin.navigator.PushStateNavigation)1 View (com.vaadin.navigator.View)1 ThemeResource (com.vaadin.server.ThemeResource)1 VaadinRequest (com.vaadin.server.VaadinRequest)1