Class AccountWidget
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.AccountWidget
- All Implemented Interfaces:
Component
Account-state widget that renders either guest links or authenticated user actions.
Configuration is mutable and not thread-safe. Rendering generates state-derived content without modifying stored children, and forwards context to inherited children. Configure before sharing; custom child delegates and request contexts have their own sharing requirements.
Authenticated actions use disclosure navigation, not an ARIA menu. Load framework JS/CSS once in the shell for native-button activation and dismissal.
-
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Method Summary
Modifier and TypeMethodDescriptionstatic AccountWidgetcreateAuthenticated(String username) Creates an authenticated-state widget.static HtmlTagcreateDynamic(String endpoint) Creates an HTMX placeholder that loads widget HTML from an application-controlled or separately endpoint-validated URL.static AccountWidgetCreates a guest-state widget.Generates account content followed by inherited children without mutating either.withLoginUrl(String url) Sets an application-controlled or separately navigation-validated login URL.withLogoutUrl(String url) Sets an application-controlled or separately navigation-validated logout URL.withProfileUrl(String url) Sets an application-controlled or separately navigation-validated profile URL.withSignupUrl(String url) Sets an application-controlled or separately navigation-validated signup URL.Methods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, render, withAttribute, withChild, withClass, withId, withInnerText, withInnerText, withMaxWidth, withMinWidth, withUnsafeHtml, withWidth
-
Method Details
-
createGuest
-
createAuthenticated
Creates an authenticated-state widget.- Parameters:
username- display name- Returns:
- authenticated widget
-
createDynamic
-
withLoginUrl
Sets an application-controlled or separately navigation-validated login URL. The generated href is encoded, without Link's scheme policy.- Parameters:
url- login URL- Returns:
- this widget
-
withSignupUrl
Sets an application-controlled or separately navigation-validated signup URL. The generated href is encoded, without Link's scheme policy; null omits the signup link.- Parameters:
url- signup URL- Returns:
- this widget
-
withProfileUrl
Sets an application-controlled or separately navigation-validated profile URL. The generated href is encoded, without Link's scheme policy.- Parameters:
url- profile URL- Returns:
- this widget
-
withLogoutUrl
Sets an application-controlled or separately navigation-validated logout URL. The generated href is encoded, without Link's scheme policy or endpoint authorization.- Parameters:
url- logout URL- Returns:
- this widget
-
getChildrenStream
Generates account content followed by inherited children without mutating either.- Overrides:
getChildrenStreamin classHtmlTag
-