@Tag(value="vaadin-app-layout") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="22.0.21") @NpmPackage(value="@vaadin/app-layout",version="22.0.21") @NpmPackage(value="@vaadin/vaadin-app-layout",version="22.0.21") @JsModule(value="@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule(value="@vaadin/app-layout/src/vaadin-app-layout.js") public class AppLayout extends Component implements RouterLayout
<vaadin-app-layout>
element. Provides a
quick and easy way to get a common application layout.Modifier and Type | Class and Description |
---|---|
static class |
AppLayout.Section
Sections in the component that can be used as primary.
|
Constructor and Description |
---|
AppLayout() |
Modifier and Type | Method and Description |
---|---|
void |
addToDrawer(Component... components)
Adds the components to the drawer slot of this AppLayout.
|
void |
addToNavbar(boolean touchOptimized,
Component... components)
Adds the components to the navbar slot of this AppLayout.
|
void |
addToNavbar(Component... components)
Adds the components to the navbar slot of this AppLayout.
|
protected void |
afterNavigation()
Called after a navigation event.
|
Component |
getContent() |
AppLayout.Section |
getPrimarySection() |
boolean |
isDrawerOpened()
Whether the drawer is opened (visible) or not.
|
boolean |
isOverlay()
Note: This property is controlled via CSS and can not be
changed directly.
|
void |
remove(Component... components)
Removes the child components from the parent.
|
void |
setContent(Component content)
Sets the displayed content.
|
void |
setDrawerOpened(boolean drawerOpened)
Server-side API for showing and hiding the drawer.
|
void |
setPrimarySection(AppLayout.Section primarySection)
Defines whether navbar or drawer will come first visually.
|
void |
showRouterLayoutContent(HasElement content)
Shows the content of the layout which is the router target component
annotated with a
@Route . |
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
removeRouterLayoutContent
getElement
addAttachListener
addDetachListener
@Synchronize(value="primary-section-changed") public AppLayout.Section getPrimarySection()
AppLayout.Section.NAVBAR
.setPrimarySection(Section)
public void setPrimarySection(AppLayout.Section primarySection)
AppLayout.Section.NAVBAR
, the navbar takes the full available width
and moves the drawer down. This is the default.AppLayout.Section.DRAWER
is set, then the drawer will move the
navbar, taking the full available height.primarySection
- new value for the primarySection property. Not null
.NullPointerException
- if primarySection is null
.@Synchronize(value="drawer-opened-changed") public boolean isDrawerOpened()
true
for desktop size viewsfalse
for mobile size viewstrue
if the drawer is opened (visible). false
otherwise.public void setDrawerOpened(boolean drawerOpened)
drawerOpened
- new value for the drawerOpened property.isDrawerOpened()
,
for a component that allows the user to open and close
the drawer.
@Synchronize(value="overlay-changed") public boolean isOverlay()
true
if drawer is an overlay on top of the content.
false
otherwise.public Component getContent()
public void setContent(Component content)
content
- Component
to display in the content areapublic void addToDrawer(Component... components)
components
- Components to add to the drawer slot.NullPointerException
- if any of the components is null or if the components array
is null.public void addToNavbar(Component... components)
components
- Components to add to the navbar slot.NullPointerException
- if any of the components is null or if the components array
is null.public void addToNavbar(boolean touchOptimized, Component... components)
touchOptimized
- if true, the components will be moved to the bottom navbar
area on mobile devices.components
- Components to add to the navbar slot.NullPointerException
- if any of the components is null or if the components array
is null.public void remove(Component... components)
components
- Components to remove.public void showRouterLayoutContent(HasElement content)
@Route
.
Note implementors should not care about old
@Route
content, since it's handled separately by
RouterLayout.removeRouterLayoutContent(HasElement)
which by default simply
removes the old content.
showRouterLayoutContent
in interface RouterLayout
content
- the content component or null
if the layout content is
to be cleared.IllegalArgumentException
- if content is not a Component
protected void afterNavigation()
Copyright © 2022. All rights reserved.