Class CalloutModule
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.core.Module
io.mindspice.simplypages.modules.CalloutModule
- All Implemented Interfaces:
Component
Module for highlighted informational callout blocks.
Mutability and thread-safety: mutable and not thread-safe. Content/type flags are mutable configuration state; mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidComposes module structure.static CalloutModulecreate()Makes the callout dismissible with a close button.error()Sets error type (red, negative).info()Sets info type (blue, informational).note()Sets note type (gray, neutral).success()Sets success type (green, positive).warning()Sets warning type (yellow, caution).withContent(String content) Sets the callout content.withCustomContent(Component content) Sets custom component content.Sets a custom icon for the callout.withModuleId(String moduleId) Sets module id and synchronizes the underlyingidattribute.Sets optional title consumed byModule.buildContent()implementations.Methods inherited from class Module
build, getModuleId, getTitle, invalidateContent, rebuildContent, render, render, withClass, withMaxWidth, withMinWidth, withWidthMethods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, withAttribute, withChild, withId, withInnerText, withInnerText, withUnsafeHtml
-
Constructor Details
-
CalloutModule
public CalloutModule()
-
-
Method Details
-
create
-
withTitle
Description copied from class:ModuleSets optional title consumed byModule.buildContent()implementations. -
withModuleId
Description copied from class:ModuleSets module id and synchronizes the underlyingidattribute.- Overrides:
withModuleIdin classModule
-
withContent
Sets the callout content.- Parameters:
content- the text content
-
withCustomContent
Sets custom component content.- Parameters:
content- custom component
-
info
Sets info type (blue, informational). -
warning
Sets warning type (yellow, caution). -
success
Sets success type (green, positive). -
error
Sets error type (red, negative). -
note
Sets note type (gray, neutral). -
withIcon
Sets a custom icon for the callout.- Parameters:
icon- icon class or HTML
-
dismissible
Makes the callout dismissible with a close button. -
buildContent
protected void buildContent()Description copied from class:ModuleComposes module structure.Called at most once by
Module.build()unlessModule.rebuildContent()is invoked. Do not rely on this method for per-request mutation.- Specified by:
buildContentin classModule
-