Skip to content

Commit

Permalink
docs: add missing javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
mlopezFC committed Sep 17, 2024
1 parent b3e13a1 commit 9ff2758
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,18 @@ public class ChatAssistant extends Div {
private boolean minimized = false;
private Registration defaultSubmitListenerRegistration;

/**
* Default constructor. Creates a ChatAssistant with no messages.
*/
public ChatAssistant() {
this(new ArrayList<>());
}

/**
* Creates a ChatAssistant with the given list of messages.
*
* @param messages the list of messages
*/
public ChatAssistant(List<Message> messages) {
this.messages = messages;
content.getElement().setAttribute("slot", "content");
Expand Down Expand Up @@ -148,9 +156,10 @@ public void clearWhoIsTyping() {
}

/**
* Sets the SubmitListener that will be notified when the user submits a message on the underlying messageInput
* @param listener
* @return
* Sets the SubmitListener that will be notified when the user submits a message on the underlying messageInput.
*
* @param listener the listener that will be notified when the SubmitEvent is fired
* @return registration for removal of the listener
*/
public Registration setSubmitListener(ComponentEventListener<SubmitEvent> listener) {
defaultSubmitListenerRegistration.remove();
Expand Down

0 comments on commit 9ff2758

Please sign in to comment.