Class ChatMessage
java.lang.Object
com.vaadin.flow.component.Component
com.flowingcode.vaadin.addons.chatassistant.ChatMessage
- 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
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(Message message) Creates a new ChatMessage based on the supplied message without markdown support.ChatMessage(Message message, boolean markdownEnabled) Creates a new ChatMessage based on the supplied message. -
Method Summary
Modifier and TypeMethodDescriptionReturns the underlying message.voidsetMessage(Message 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
-