Class ComparisonModule
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.core.Module
io.mindspice.simplypages.modules.ComparisonModule
- All Implemented Interfaces:
Component
Module for side-by-side comparison tables.
Mutability and thread-safety: mutable and not thread-safe. Column and row collections are mutable and consumed during build; 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 ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a comparison column.Adds a comparison column with optional highlighting.Adds a comparison row with string values for each column.addRowWithComponents(String label, Component... values) Adds a comparison row with custom component values.protected voidComposes module structure.static ComparisonModulecreate()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
-
ComparisonModule
public ComparisonModule()
-
-
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
-
addColumn
Adds a comparison column.- Parameters:
name- the column name/header
-
addColumn
Adds a comparison column with optional highlighting.- Parameters:
name- the column name/headerhighlighted- whether to highlight this column (e.g., "recommended")
-
addRow
Adds a comparison row with string values for each column.- Parameters:
label- the row label (attribute name)values- values for each column (must match column count)
-
addRowWithComponents
Adds a comparison row with custom component values.- Parameters:
label- the row label (attribute name)values- custom components for each column
-
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
-