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.router.RouterLayout,Serializable
@CssImport("./org/vaadin/firitin/layouts/appframework.css") @CssImport("lumo-css-framework/all-classes.css") @NpmPackage(value="lumo-css-framework", version="3.0.11") public abstract class MainLayout extends com.vaadin.flow.component.applayout.AppLayoutThe 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
MenuItemannotationCheck usage example from the text package org.vaadin.firitin.appframework
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MainLayout()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidafterNavigation()voidbuildMenu()This method can be called to re-build the menu, if e.g.protected booleancheckAccess(NavigationItem navigationItem)Application that has access control can limit the appearance of the navigation item in the menu by returning false here.voidcloseSubView()voidcloseSubView(com.vaadin.flow.component.Component component)protected com.vaadin.flow.component.ComponentcreateDrawerContent()protected com.vaadin.flow.component.html.FootercreateFooter()protected com.vaadin.flow.component.ComponentcreateHeaderContent()protected abstract StringgetDrawerHeader()List<NavigationItem>getNavigationItems()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)voidsetContent(com.vaadin.flow.component.Component content)protected voidsortMenuItems()-
Methods inherited from class com.vaadin.flow.component.applayout.AppLayout
addToDrawer, addToNavbar, addToNavbar, getContent, getPrimarySection, isDrawerOpened, isOverlay, remove, setDrawerOpened, setPrimarySection, showRouterLayoutContent
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
-
-
-
-
Method Detail
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
- Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
init
protected void init()
-
sortMenuItems
protected void sortMenuItems()
-
getNavigationItems
public List<NavigationItem> getNavigationItems()
- Returns:
- A List of
NavigationItemobjects to be shown in the menu. After modifying these manually, callbuildMenu()to update the screen.
-
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.
-
checkAccess
protected boolean checkAccess(NavigationItem navigationItem)
Application that has access control can limit the appearance of the navigation item in the menu by returning false here.- Parameters:
navigationItem- the navigation item- Returns:
- true if item should be visible or not
-
createHeaderContent
protected com.vaadin.flow.component.Component createHeaderContent()
-
createDrawerContent
protected com.vaadin.flow.component.Component createDrawerContent()
-
getDrawerHeader
protected abstract String getDrawerHeader()
-
afterNavigation
protected void afterNavigation()
- Overrides:
afterNavigationin classcom.vaadin.flow.component.applayout.AppLayout
-
setContent
public void setContent(com.vaadin.flow.component.Component content)
- Overrides:
setContentin classcom.vaadin.flow.component.applayout.AppLayout
-
openSubView
public void openSubView(com.vaadin.flow.component.Component component, String viewTitle)
-
openSubView
public void openSubView(com.vaadin.flow.component.Component component)
-
closeSubView
public void closeSubView(com.vaadin.flow.component.Component component)
-
closeSubView
public void closeSubView()
-
createFooter
protected com.vaadin.flow.component.html.Footer createFooter()
-
-