Class ChatMessage<T extends Message>
java.lang.Object
com.vaadin.flow.component.Component
com.flowingcode.vaadin.addons.chatassistant.ChatMessage<T>
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasComponents,HasElement,HasEnabled,HasStyle,Serializable
@JsModule("@vaadin/message-list/src/vaadin-message.js")
@Tag("vaadin-message")
@CssImport("./styles/chat-message-styles.css")
public class ChatMessage<T extends Message>
extends Component
implements HasComponents
Component that wraps the vaadin-message web component and builds it based on a Message.
- Author:
- mmlopez
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionChatMessage(T message) Creates a new ChatMessage based on the supplied message without markdown support.ChatMessage(T message, boolean markdownEnabled) Creates a new ChatMessage based on the supplied message. -
Method Summary
Modifier and TypeMethodDescriptionReturns the underlying message.voidsetMessage(T message) Updates the component by setting the current underlying message.Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, 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.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
ChatMessage
Creates a new ChatMessage based on the supplied message without markdown support.- Parameters:
message- message used to populate the ChatMessage instance
-
ChatMessage
Creates a new ChatMessage based on the supplied message.- Parameters:
message- message used to populate the ChatMessage instancemarkdownEnabled- whether the message supports markdown or not
-
-
Method Details
-
setMessage
Updates the component by setting the current underlying message.- Parameters:
message- message used to populate the ChatMessage instance
-
getMessage
Returns the underlying message.- Returns:
- the message object used to populate this ChatMessage
-