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 Details

    • ChatMessage

      public ChatMessage(Message message)
      Creates a new ChatMessage based on the supplied message without markdown support.
      Parameters:
      message - message used to populate the ChatMessage instance
    • ChatMessage

      public ChatMessage(Message message, boolean markdownEnabled)
      Creates a new ChatMessage based on the supplied message.
      Parameters:
      message - message used to populate the ChatMessage instance
      markdownEnabled - whether the message supports markdown or not
  • Method Details

    • setMessage

      public void setMessage(Message message)
      Updates the component by setting the current underlying message.
      Parameters:
      message - message used to populate the ChatMessage instance
    • getMessage

      public Message getMessage()
      Returns the underlying message.
      Returns:
      the message object used to populate this ChatMessage