Package io.jmix.aichat.component.chat
Class AttachmentClickEvent<T extends AiChatMessage>
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<AiChat<T>>
io.jmix.aichat.component.chat.AttachmentClickEvent<T>
- Type Parameters:
T- the message type
- All Implemented Interfaces:
Serializable
public class AttachmentClickEvent<T extends AiChatMessage>
extends com.vaadin.flow.component.ComponentEvent<AiChat<T>>
Fired when the user clicks an attachment of a message. The message is resolved when the
click arrives — from the source message the clicked item was rendered from — so a change
to the bound items between the click and its handling cannot shift it. It is
null when the clicked item has no domain message behind it.- See Also:
-
Field Summary
FieldsFields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionAttachmentClickEvent(AiChat<T> source, boolean fromClient, @Nullable T message, int attachmentIndex) Creates the event. -
Method Summary
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, getUI, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Field Details
-
message
-
attachmentIndex
protected int attachmentIndex
-
-
Constructor Details
-
AttachmentClickEvent
public AttachmentClickEvent(AiChat<T> source, boolean fromClient, @Nullable T message, int attachmentIndex) Creates the event.- Parameters:
source- the source componentfromClient-trueif the event comes from the clientmessage- the message whose attachment was clicked, ornullwhen the clicked item has no domain message behind itattachmentIndex- the index of the clicked attachment within that message
-
-
Method Details
-
getMessage
- Returns:
- the message whose attachment was clicked, or
nullwhen the clicked item has no domain message — the transient bubble a stopped or failed generation leaves behind, or an item an application added to the inner list itself
-
getFileRef
- Returns:
- the clicked file, or
nullwhen there is no message behind the item or the attachment index does not resolve against it
-