1. Domino UI
  2. Layouts
  3. Application layout

Application Layout

The AppLayout class represents the main layout structure for a web application. It provides options for creating a responsive layout with a navigation bar, content area, and drawers.

See also :

Anatomy

app-layout-anatomy
  1. Navigation bar.
  2. Application title, a description can also be added to show under the title.
  3. Navigation bar prefix elements, will always be appended to the left of the title.
  4. Left drawer toggle button.
  5. Navigation bar postfix elements, will always be appended to the right most of the navigation bar.
  6. Left drawer, can span up to cover the navigation bar, or span down to cover the footer, or can be placed under the navigation bar or above the footer.
  7. Right drawer toggle button.
  8. Right drawer, cant span up or down to cover the navigation bar or the footer.
  9. Footer, can be fixed at the bottom of the screen or set to scroll with the body.
  10. Main content panel.

Examples

Constructors

public void AppLayout()
Constructs an AppLayout with default settings.
public void AppLayout(String title)
Creates a new instance of AppLayout with a specified title.

title

The title to be displayed in the navigation bar.



Returns:

A new AppLayout instance.

Static methods

public static AppLayout create()
Creates a new instance of AppLayout with default settings.

Returns:

A new AppLayout instance.

public static AppLayout create(String title)
Creates a new instance of AppLayout with a specified title.

title

The title to be displayed in the navigation bar.



Returns:

A new AppLayout instance.

Public methods

public DivElement getLayout()
Retrieves the layout element of this AppLayout .

Returns:

The layout element as a DivElement .

public SectionElement getBody()
Retrieves the body section element of this AppLayout .

Returns:

The body section element as a SectionElement .

public SectionElement getContent()
Retrieves the content section element of this AppLayout .

Returns:

The content section element as a SectionElement .

public NavBar getNavBar()
Retrieves the navigation bar associated with this AppLayout .

Returns:

The navigation bar as a NavBar instance.

public HeaderElement getHeader()
Retrieves the header element of this AppLayout .

Returns:

The header element as a HeaderElement .

public SectionElement getFooter()
Retrieves the footer section element of this AppLayout .

Returns:

The footer section element as a SectionElement .

public SectionElement getLeftDrawer()
Retrieves the left drawer section element of this AppLayout .

Returns:

The left drawer section element as a SectionElement .

public AsideElement getLeftDrawerContent()
Retrieves the content of the left drawer as an AsideElement .

Returns:

The left drawer content as an AsideElement .

public SectionElement getRightDrawer()
Retrieves the right drawer section element of this AppLayout .

Returns:

The right drawer section element as a SectionElement .

public SectionElement getRightDrawerContent()
Retrieves the content of the right drawer as a SectionElement .

Returns:

The right drawer content as a SectionElement .

public AppLayout withLayout(ChildHandler<AppLayout, DivElement> handler)
Configures the layout element using a custom handler.

handler

The handler for configuring the layout.



Returns:

This AppLayout instance for method chaining.

public AppLayout withBody(ChildHandler<AppLayout, SectionElement> handler)
Configures the body section element using a custom handler.

handler

The handler for configuring the body section.



Returns:

This AppLayout instance for method chaining.

public AppLayout withContent(ChildHandler<AppLayout, SectionElement> handler)
Configures the content section element using a custom handler.

handler

The handler for configuring the content section.



Returns:

This AppLayout instance for method chaining.

public AppLayout withNavBar(ChildHandler<AppLayout, NavBar> handler)
Configures the navigation bar using a custom handler.

handler

The handler for configuring the navigation bar.



Returns:

This AppLayout instance for method chaining.

public AppLayout withHeader(ChildHandler<AppLayout, HeaderElement> handler)
Configures the header element using a custom handler.

handler

The handler for configuring the header element.



Returns:

This AppLayout instance for method chaining.

public AppLayout withFooter(ChildHandler<AppLayout, SectionElement> handler)
Configures the footer section element using a custom handler.

handler

The handler for configuring the footer section.



Returns:

This AppLayout instance for method chaining.

public AppLayout withLeftDrawer(ChildHandler<AppLayout, SectionElement> handler)
Configures the left drawer section element using a custom handler.

handler

The handler for configuring the left drawer section.



Returns:

This AppLayout instance for method chaining.

public AppLayout withRightDrawer(ChildHandler<AppLayout, SectionElement> handler)
Configures the right drawer section element using a custom handler.

handler

The handler for configuring the right drawer section.



Returns:

This AppLayout instance for method chaining.

public AppLayout withLeftDrawerContent(ChildHandler<AppLayout, AsideElement> handler)
Configures the content of the left drawer using a custom handler.

handler

The handler for configuring the left drawer content.



Returns:

This AppLayout instance for method chaining.

public AppLayout withRightDrawerContent(ChildHandler<AppLayout, SectionElement> handler)
Configures the content of the right drawer using a custom handler.

handler

The handler for configuring the right drawer content.



Returns:

This AppLayout instance for method chaining.

public AppLayout withNavBar()
Retrieves and initializes the navigation bar.

Returns:

This AppLayout instance for method chaining.

public AppLayout withHeader()
Retrieves and initializes the header element.

Returns:

This AppLayout instance for method chaining.

public AppLayout withFooter()
Retrieves and initializes the footer section element.

Returns:

This AppLayout instance for method chaining.

public AppLayout withLeftDrawer()
Retrieves and initializes the left drawer section element.

Returns:

This AppLayout instance for method chaining.

public AppLayout withRightDrawer()
Retrieves and initializes the right drawer section element.

Returns:

This AppLayout instance for method chaining.

public AppLayout withLeftDrawerContent()
Retrieves and initializes the content of the left drawer.

Returns:

This AppLayout instance for method chaining.

public AppLayout withRightDrawerContent()
Retrieves and initializes the content of the right drawer.

Returns:

This AppLayout instance for method chaining.

public AppLayout setLeftDrawerSize(LeftDrawerSize size)
Sets the size of the left drawer.

size

The size of the left drawer.



Returns:

This AppLayout instance for method chaining.

public AppLayout setRightDrawerSize(RightDrawerSize size)
Sets the size of the right drawer.

size

The size of the right drawer.



Returns:

This AppLayout instance for method chaining.

public AppLayout toggleLeftDrawerSpanUp()
Toggles the left drawer to display with a span-up effect.

Returns:

This AppLayout instance for method chaining.

public AppLayout setLeftDrawerSpanUp(boolean spanUp)
Sets whether the left drawer should display with a span-up effect.

spanUp

true to enable the span-up effect, false to disable it.



Returns:

This AppLayout instance for method chaining.

public AppLayout toggleLeftDrawerSpanDown()
Toggles the left drawer to display with a span-down effect.

Returns:

This AppLayout instance for method chaining.

public AppLayout setLeftDrawerSpanDown(boolean spanDown)
Sets whether the left drawer should display with a span-down effect.

spanDown

true to enable the span-down effect, false to disable it.



Returns:

This AppLayout instance for method chaining.

public AppLayout toggleShrinkContent()
Toggles the content to shrink when drawers are opened.

Returns:

This AppLayout instance for method chaining.

public AppLayout setShrinkContent(boolean shrink)
Sets whether the content should shrink when drawers are opened.

shrink

true to enable content shrinking, false to disable it.



Returns:

This AppLayout instance for method chaining.

public AppLayout toggleLeftOverlay()
Toggles the left overlay effect.

Returns:

This AppLayout instance for method chaining.

public AppLayout toggleRightOverlay()
Toggles the right overlay effect.

Returns:

This AppLayout instance for method chaining.

public AppLayout toggleLeftDrawer()
Toggles the left drawer open or closed.

Returns:

This AppLayout instance for method chaining.

public AppLayout toggleRightDrawer()
Toggles the right drawer open or closed.

Returns:

This AppLayout instance for method chaining.

public AppLayout toggleFixedFooter()
Toggles the fixed footer layout.

Returns:

This AppLayout instance for method chaining.

public AppLayout setFixedFooter(boolean fixed)
Sets whether the footer should be fixed or not.

fixed

true to fix the footer, false to unfix it.



Returns:

This AppLayout instance for method chaining.

public AppLayout showLeftDrawer()
Shows the left drawer.

Returns:

This AppLayout instance for method chaining.

public AppLayout hideLeftDrawer()
Hides the left drawer.

Returns:

This AppLayout instance for method chaining.

public AppLayout showRightDrawer()
Shows the right drawer.

Returns:

This AppLayout instance for method chaining.

public AppLayout hideRightDrawer()
Hides the right drawer.

Returns:

This AppLayout instance for method chaining.

public AppLayout setLeftDrawerToggleIcon(Icon<?> icon)
Sets the icon for the left drawer toggle button.

icon

The icon to set.



Returns:

This AppLayout instance for method chaining.

public AppLayout setRightDrawerToggleIcon(Icon<?> icon)
Sets the icon for the right drawer toggle button.

icon

The icon to set.



Returns:

This AppLayout instance for method chaining.

public AppLayout setAutoCloseLeftDrawer(boolean autoCloseLeftDrawer)
Sets whether the left drawer should automatically close when clicking outside it.

autoCloseLeftDrawer

true to enable auto-closing, false to disable it.



Returns:

This AppLayout instance for method chaining.

public AppLayout setFixLeftDrawer(boolean fixed)
Sets the left drawer to be fixed or unfixed, depending on the provided boolean.

fixed

true to fix the left drawer, false to unfix it.



Returns:

This AppLayout instance for method chaining.

public AppLayout setAutoCloseRightDrawer(boolean autoCloseRightDrawer)
Sets whether the right drawer should automatically close when clicking outside it.

autoCloseRightDrawer

true to enable auto-closing, false to disable it.



Returns:

This AppLayout instance for method chaining.

public AppLayout withLeftDrawerToggle(ChildHandler<AppLayout, PrefixAddOn<HTMLElement>> handler)
Configures the left drawer toggle button using the provided handler.

handler

The handler for configuring the left drawer toggle button.



Returns:

This AppLayout instance for method chaining.

public AppLayout setLeftDrawerToggleVisible(boolean visible)
Sets the visibility of the left drawer toggle button.

visible

true to make the toggle button visible, false to hide it.



Returns:

This AppLayout instance for method chaining.

public boolean isLeftDrawerOpen()
Checks whether the left drawer is currently open.

Returns:

true if the left drawer is open, false otherwise.

public boolean isRightDrawerOpen()
Checks whether the right drawer is currently open.

Returns:

true if the right drawer is open, false otherwise.

public AppLayout onLeftDrawerOpen(ChildHandler<AppLayout, SectionElement> handler)
Registers a listener to be called when the left drawer is opened.

handler

The handler to be called when the left drawer is opened.



Returns:

This AppLayout instance for method chaining.

public AppLayout removeLeftDrawerOpenListener(ChildHandler<AppLayout, SectionElement> handler)
Removes a listener that was previously registered to be called when the left drawer is opened.

handler

The handler to be removed from the list of listeners.



Returns:

This AppLayout instance for method chaining.

public AppLayout onLeftDrawerClosed(ChildHandler<AppLayout, SectionElement> handler)
Registers a listener to be called when the left drawer is closed.

handler

The handler to be called when the left drawer is closed.



Returns:

This AppLayout instance for method chaining.

public AppLayout removeLeftDrawerCloseListener(ChildHandler<AppLayout, SectionElement> handler)
Removes a listener that was previously registered to be called when the left drawer is closed.

handler

The handler to be removed from the list of listeners.



Returns:

This AppLayout instance for method chaining.

public AppLayout onRightDrawerOpen(ChildHandler<AppLayout, SectionElement> handler)
Registers a listener to be called when the right drawer is opened.

handler

The handler to be called when the right drawer is opened.



Returns:

This AppLayout instance for method chaining.

public AppLayout removeRightDrawerOpenListener(ChildHandler<AppLayout, SectionElement> handler)
Removes a listener that was previously registered to be called when the right drawer is opened.

handler

The handler to be removed from the list of listeners.



Returns:

This AppLayout instance for method chaining.

public AppLayout onRightDrawerClosed(ChildHandler<AppLayout, SectionElement> handler)
Registers a listener to be called when the right drawer is closed.

handler

The handler to be called when the right drawer is closed.



Returns:

This AppLayout instance for method chaining.

public AppLayout removeRightDrawerCloseListener(ChildHandler<AppLayout, SectionElement> handler)
Removes a listener that was previously registered to be called when the right drawer is closed.

handler

The handler to be removed from the list of listeners.



Returns:

This AppLayout instance for method chaining.

We are a group of passionate people who love what we do

Donate & Support Us