Class Page.PageBuilder
- Enclosing class:
Page
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddComponents(Component... components) Appends multiple components in argument order.Appends a row to page content.Builds a new row via consumer and appends it using the same routing asaddRow(Row).build()Finalizes and returns the configured page.Enables page-area independent scrolling by adding framework class hooks.withStickySidebar(Component stickyComponent) Enables sticky-sidebar layout with default widths (8 main, 4 sidebar).withStickySidebar(Component stickyComponent, int mainWidth, int sidebarWidth) Enables sticky-sidebar layout with explicit 12-grid widths.
-
Constructor Details
-
PageBuilder
public PageBuilder()
-
-
Method Details
-
addRow
Appends a row to page content. When sticky mode is enabled, appends to sticky main area.- Parameters:
row- row to append- Returns:
- this builder
-
addRow
Builds a new row via consumer and appends it using the same routing asaddRow(Row).- Parameters:
rowConsumer- consumer that mutates a fresh row- Returns:
- this builder
-
addComponents
Appends multiple components in argument order.Components are routed to sticky main content when sticky mode is active.
- Parameters:
components- components to append- Returns:
- this builder
-
withIndependentScrolling
Enables page-area independent scrolling by adding framework class hooks.- Returns:
- this builder
-
withStickySidebar
public Page.PageBuilder withStickySidebar(Component stickyComponent, int mainWidth, int sidebarWidth) Enables sticky-sidebar layout with explicit 12-grid widths.Calling this method also enables independent scrolling. Call before
addRow/addComponentsso subsequent content is routed to the sticky main area.One native details/summary disclosure starts closed. Framework JS opens it at widths of 769px and above; fresh mobile disclosures through 768px remain closed, and each element's observed native/application open preference is remembered. Replacement elements initialize independently; ordinary nested details are unchanged. This is separate from the shell's mobile drawer.
The generated aside has tabindex -1 for programmatic focus fallback, not a Tab stop. Caller details attributes are preserved. Without JS, the disclosure starts closed at all widths and its summary remains keyboard-operable; a focused open desktop summary stays visible for native keyboard recovery.
- Parameters:
stickyComponent- component rendered in the sidebarmainWidth- main-area width in [1,12]sidebarWidth- sidebar width in [1,12]- Returns:
- this builder
- Throws:
IllegalArgumentException- when widths are out of range or sum above 12
-
withStickySidebar
Enables sticky-sidebar layout with default widths (8 main, 4 sidebar).- Parameters:
stickyComponent- component rendered in the sidebar- Returns:
- this builder
-
build
Finalizes and returns the configured page.Build is idempotent for unchanged builder state. Sticky-sidebar layout containers and scroll classes are only attached once.
- Returns:
- configured page instance
-