Class DefaultForumCommentComponent
java.lang.Object
io.mindspice.simplypages.components.forum.comments.DefaultForumCommentComponent
- All Implemented Interfaces:
ForumCommentComponent, Component
Default flat comment card with raw depth metadata and bounded CSS indentation.
Every card emits the configured signed int as data-depth. Only the
visual class is clamped to forum-comment-depth-0 through
forum-comment-depth-4; negative depths look like zero. Framework CSS indents
from the logical start by 16px per level (8px at viewport widths up to 920px), limited
to 8% of the containing inline size. Host CSS can override these defaults.
Depth and parent ID are independent metadata, not a validated hierarchy. Rendering keeps configured state unchanged and dispatches body/actions with the supplied context. Templates retain live rendering, including later configuration and subclass overrides. Finish configuration before sharing; contexts and child delegates have their own sharing requirements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultForumCommentComponentcreate()render(RenderContext context) Renders this component using the supplied render context.withActions(List<Component> actions) withAuthor(String author) withAvatarUrl(String avatarUrl) withCommentId(String id) withDepth(int depth) Stores the raw depth unchanged; only its default visual class is clamped to 0..4.withParentId(String parentId) withReplies(Integer replies) withTimestamp(String timestamp) withTopicId(String topicId)
-
Constructor Details
-
DefaultForumCommentComponent
public DefaultForumCommentComponent()
-
-
Method Details
-
create
-
withCommentId
- Specified by:
withCommentIdin interfaceForumCommentComponent
-
withTopicId
- Specified by:
withTopicIdin interfaceForumCommentComponent
-
withParentId
- Specified by:
withParentIdin interfaceForumCommentComponent
-
withDepth
Stores the raw depth unchanged; only its default visual class is clamped to 0..4.- Specified by:
withDepthin interfaceForumCommentComponent- Parameters:
depth- any signed int, independent of the parent ID- Returns:
- this component
-
withAuthor
- Specified by:
withAuthorin interfaceForumCommentComponent
-
withAvatarUrl
- Specified by:
withAvatarUrlin interfaceForumCommentComponent
-
withTimestamp
- Specified by:
withTimestampin interfaceForumCommentComponent
-
withBody
- Specified by:
withBodyin interfaceForumCommentComponent
-
withActions
- Specified by:
withActionsin interfaceForumCommentComponent
-
withLikes
- Specified by:
withLikesin interfaceForumCommentComponent
-
withReplies
- Specified by:
withRepliesin interfaceForumCommentComponent
-
render
Description copied from interface:ComponentRenders this component using the supplied render context.
-