Class TopNavBuilder
java.lang.Object
io.mindspice.simplypages.builders.TopNavBuilder
Builds a top-level navigation component with primary and utility regions.
Contract: generated link entries include HTMX navigation attributes
(`hx-get`, `hx-target`, `hx-push-url`) targeting #content-area by default.
Mutability and thread-safety: mutable and not thread-safe. Intended for single request or setup flow use; do not share a builder instance across threads.
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated.addPrimaryComponent(Component component) Adds a custom primary component.addPrimaryDropdown(String triggerText, Consumer<Dropdown> dropdownConfig) Adds a primary dropdown (left-aligned menu).addPrimaryLink(String text, String href) Adds a non-active primary link with an application-controlled or separately validated navigation/HTMX destination.addPrimaryLink(String text, String href, boolean active) Adds a primary link with explicit active state and a trusted/context-validated href.addUtilityComponent(Component component) Adds a custom utility component.addUtilityDropdown(String triggerText, Consumer<Dropdown> dropdownConfig) Adds a utility dropdown (right-aligned menu).addUtilityLink(String text, String href) Adds a utility link with an application-controlled or separately navigation/endpoint-validated href, without Link's scheme policy.addUtilityLink(String text, String href, boolean active) Adds a utility link with explicit active state and a trusted/context-validated href.build()Builds a newNavBarsnapshot from current builder state.static TopNavBuildercreate()Creates a new builder instance.withAccountWidget(Component widget) Adds a custom account widget component to the utility region.withAuthenticatedAccountWidget(String username) Adds an authenticated account widget to the utility region.Sets optional navigation brand text.Adds a custom class to the rendered top-nav container.withContentTarget(String target) Sets the HTMX target used for generated links.withDynamicAccountWidget(String endpoint) Adds an HTMX-loaded account widget using an application-controlled or separately endpoint-validated URL.Adds a guest account widget to the utility region.withHtmxNavigation(boolean enabled) Enables or disables HTMX navigation attributes for generated links.
-
Method Details
-
create
Creates a new builder instance. -
withBrand
Sets optional navigation brand text. -
withClass
Adds a custom class to the rendered top-nav container. -
addPrimaryLink
Adds a non-active primary link with an application-controlled or separately validated navigation/HTMX destination. No Link scheme policy is applied. -
addPrimaryLink
Adds a primary link with explicit active state and a trusted/context-validated href. The same URL supplies hx-get when enabled; encoding is not destination validation. -
addPrimaryComponent
Adds a custom primary component. -
addPrimaryDropdown
Adds a primary dropdown (left-aligned menu). -
addUtilityLink
Adds a utility link with an application-controlled or separately navigation/endpoint-validated href, without Link's scheme policy. -
addUtilityLink
Adds a utility link with explicit active state and a trusted/context-validated href. The URL also supplies hx-get when enabled; no destination policy is enforced. -
addUtilityDropdown
Adds a utility dropdown (right-aligned menu). -
addUtilityComponent
Adds a custom utility component. -
withGuestAccountWidget
Adds a guest account widget to the utility region. -
withAuthenticatedAccountWidget
Adds an authenticated account widget to the utility region. -
withDynamicAccountWidget
Adds an HTMX-loaded account widget using an application-controlled or separately endpoint-validated URL. Encoding does not authorize requests. -
withAccountWidget
Adds a custom account widget component to the utility region. -
addPortal
Deprecated.Legacy alias for a non-active primary link; path has the application-controlled or separately navigation/endpoint-validated contract ofaddPrimaryLink(String, String). -
addPortal
Deprecated.Legacy alias for a primary link with active state; path has the trusted/context-validated contract ofaddPrimaryLink(String, String, boolean), not Link's scheme policy. -
withContentTarget
Sets the HTMX target used for generated links. -
build
-