Package org.vaadin.firitin.appframework
Class MainLayout
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.applayout.AppLayout
org.vaadin.firitin.appframework.MainLayout
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.router.AfterNavigationObserver,com.vaadin.flow.router.internal.AfterNavigationHandler,com.vaadin.flow.router.RouterLayout,Serializable
public abstract class MainLayout
extends com.vaadin.flow.component.applayout.AppLayout
implements com.vaadin.flow.router.AfterNavigationObserver
The main view is a top-level placeholder for other views. This version is
based on a one produced by start.vaadin.com service, but add a bit structure
to it and populates main views automatically to it.
Suites as such for small apps that has no special needs for the main layout.
Menu items can be configured (override caption, order, icon) using
MenuItem annotation
Check usage example from the text package org.vaadin.firitin.appframework
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.vaadin.flow.component.applayout.AppLayout
com.vaadin.flow.component.applayout.AppLayout.AppLayoutI18n, com.vaadin.flow.component.applayout.AppLayout.Section -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidafterNavigation(com.vaadin.flow.router.AfterNavigationEvent event) voidThis method can be called to re-build the menu, if e.g. views has been added, removed or otherwise changed.protected booleancheckAccess(NavigationItem navigationItem) Application that has access control can limit the appearance of the navigation item in the menu by returning false here.voidvoidcloseSubView(com.vaadin.flow.component.Component component) protected com.vaadin.flow.component.html.Footerprotected abstract Stringcom.vaadin.flow.component.sidenav.SideNavgetMenu()protected voidinit()protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidopenSubView(com.vaadin.flow.component.Component component) voidopenSubView(com.vaadin.flow.component.Component component, String viewTitle) protected MainLayout.AdvancedSideNavvoidsetContent(com.vaadin.flow.component.Component content) voidsetViewTitle(String title) Manually override the current view title.protected voidsortMenuItems(List<NavigationItem> navigationItems) Methods inherited from class com.vaadin.flow.component.applayout.AppLayout
addToDrawer, addToNavbar, addToNavbar, getContent, getI18n, getPrimarySection, isDrawerOpened, isOverlay, remove, setDrawerOpened, setI18n, setPrimarySection, showRouterLayoutContentMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.router.RouterLayout
removeRouterLayoutContent
-
Constructor Details
-
MainLayout
public MainLayout()
-
-
Method Details
-
getMenu
public com.vaadin.flow.component.sidenav.SideNav getMenu() -
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.applayout.AppLayout
-
init
protected void init() -
sortMenuItems
-
buildMenu
public void buildMenu()This method can be called to re-build the menu, if e.g. views has been added, removed or otherwise changed.If you have dynamically added/removed views from another thread, wrap the behavior in UI.access method.
-
getDrawerHeader
-
setContent
public void setContent(com.vaadin.flow.component.Component content) - Overrides:
setContentin classcom.vaadin.flow.component.applayout.AppLayout
-
openSubView
-
openSubView
public void openSubView(com.vaadin.flow.component.Component component) -
closeSubView
public void closeSubView(com.vaadin.flow.component.Component component) -
closeSubView
public void closeSubView() -
setViewTitle
Manually override the current view title.- Parameters:
title- the title to set