Package com.onec.ui
Interface Layout
public interface Layout
An authored layout — the structural peer of
Page and EntityView.
One Layout bean describes one persona's shell: its navigation sections,
nav presentation, branding, and (for personas) the roles that resolve into it.
The default layout (profile() == null) is the back-office shell served
to anyone who matches no persona. A persona layout (profile() == "cleaning")
declares its target roles and its own curated sections. A layout never widens
access — RBAC still gates every data endpoint.
@Component
class MainLayout implements Layout {
public void configure(LayoutSpec s) {
s.shell().nav(NavStyle.SIDEBAR);
s.section("Rentals").icon("house")
.catalog(Property.class, c -> c.field("displayName").order(0));
}
}
-
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(LayoutSpec spec) Build this layout's sections, shell, branding and (for personas) roles.default Stringprofile()The persona id this layout builds, ornullfor the default shell.default Viewportviewport()The device class this layout targets, ornull(default) to apply to every viewport.
-
Method Details
-
profile
The persona id this layout builds, ornullfor the default shell. -
viewport
The device class this layout targets, ornull(default) to apply to every viewport. A viewport-specific layout fully replaces the universal one for the sameprofile()on that device — author a separateLayoutbean per device to curate nav and presentation independently. -
configure
Build this layout's sections, shell, branding and (for personas) roles.
-