Class TimelineUserMessageItem
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
io.jmix.aitoolsflowui.view.chat.renderer.component.TimelineUserMessageItem
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable
Timeline row for a persisted user
AiChatMessage, rendering its content as plain text.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
actor, ACTOR_CN, AVATAR_CONTAINER_CN, avatarContainer, BASE_CN, body, BODY_CN, header, HEADER_CN, time, TIME_CN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringavatarAbbreviation(String actorName) Builds the avatar initials from the actor name.protected com.vaadin.flow.component.ComponentcreateAvatar(String actorName) protected com.vaadin.flow.component.ComponentcreateMessageContent(AiChatMessage message) voidsetMessage(AiChatMessage message, String actorName) Renders the row for the given message.Methods inherited from class io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
createActor, createAvatarContainer, createBody, createHeader, createRoot, createTime, initContent, initRow, setTimeMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
USER_MESSAGE_CN
- See Also:
-
USER_MESSAGE_CONTENT_CN
- See Also:
-
AVATAR_CN
- See Also:
-
-
Constructor Details
-
TimelineUserMessageItem
public TimelineUserMessageItem()
-
-
Method Details
-
setMessage
Renders the row for the given message.- Parameters:
message- message to displayactorName- actor display name shown in the header
-
createAvatar
- Specified by:
createAvatarin classAbstractTimelineItem
-
avatarAbbreviation
Builds the avatar initials from the actor name. The Jmix user instance name embeds the login as"First Last [username]"; the bracketed login is dropped so the circle shows clean initials (e.g."JS"), falling back to the login's first letter when no name is present. Set explicitly so the Avatar does not derive noisy initials from the whole string.- Parameters:
actorName- actor display name to derive initials from- Returns:
- the avatar initials (empty string if none can be derived)
-
createMessageContent
-