Class MessageList

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.messages.MessageList
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasSize, HasStyle, LocaleChangeObserver, Serializable

@Tag("vaadin-message-list") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="24.3.11") @NpmPackage(value="@vaadin/message-list",version="24.3.11") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("./messageListConnector.js") @JsModule("@vaadin/message-list/src/vaadin-message-list.js") public class MessageList extends Component implements HasStyle, HasSize, LocaleChangeObserver
Message List allows you to show a list of messages, for example, a chat log. You can configure the text content, information about the sender and the time of sending for each message. The component displays a list of messages that can be configured with setItems(Collection).
Author:
Vaadin Ltd.
See Also:
  • Constructor Details

    • MessageList

      public MessageList()
      Creates a new message list component. To populate the content of the list, use setItems(Collection).
    • MessageList

      public MessageList(Collection<MessageListItem> items)
      Creates a new message list component, with the provided items rendered as messages.
      Parameters:
      items - the items to render as messages
      See Also:
    • MessageList

      public MessageList(MessageListItem... items)
      Creates a new message list component, with the provided items rendered as messages.
      Parameters:
      items - the items to render as messages
      See Also:
  • Method Details

    • setItems

      public void setItems(Collection<MessageListItem> items)
      Sets the items that will be rendered as messages in this message list.
      Parameters:
      items - the items to set, not null and not containing any null items
    • setItems

      public void setItems(MessageListItem... items)
      Sets the items that will be rendered as messages in this message list.
      Parameters:
      items - the items to set, none of which can be null
    • getItems

      public List<MessageListItem> getItems()
      Gets the items that are rendered as message components in this message list.
      Returns:
      an unmodifiable view of the list of items
    • localeChange

      public void localeChange(LocaleChangeEvent event)
      Description copied from interface: LocaleChangeObserver
      Notifies when the UI locale is changed.
      Specified by:
      localeChange in interface LocaleChangeObserver
      Parameters:
      event - locale change event with event details