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.7.12") @NpmPackage(value="@vaadin/message-list",version="24.7.12")
@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 Summary
ConstructorsConstructorDescriptionCreates a new message list component.MessageList(MessageListItem... items) Creates a new message list component, with the provided items rendered as messages.MessageList(Collection<MessageListItem> items) Creates a new message list component, with the provided items rendered as messages. -
Method Summary
Modifier and TypeMethodDescriptiongetItems()Gets the items that are rendered as message components in this message list.voidlocaleChange(LocaleChangeEvent event) Notifies when the UI locale is changed.voidsetItems(MessageListItem... items) Sets the items that will be rendered as messages in this message list.voidsetItems(Collection<MessageListItem> items) Sets the items that will be rendered as messages in this message list.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.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
MessageList
public MessageList()Creates a new message list component. To populate the content of the list, usesetItems(Collection). -
MessageList
Creates a new message list component, with the provided items rendered as messages.- Parameters:
items- the items to render as messages- See Also:
-
MessageList
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
Sets the items that will be rendered as messages in this message list.- Parameters:
items- the items to set, notnulland not containing anynullitems
-
setItems
Sets the items that will be rendered as messages in this message list.- Parameters:
items- the items to set, none of which can benull
-
getItems
Gets the items that are rendered as message components in this message list.- Returns:
- an unmodifiable view of the list of items
-
localeChange
Description copied from interface:LocaleChangeObserverNotifies when the UI locale is changed.- Specified by:
localeChangein interfaceLocaleChangeObserver- Parameters:
event- locale change event with event details
-