Added javadoc

This commit is contained in:
Maximilian P. Käfer 2020-10-03 15:19:37 +02:00
parent 5f0910635a
commit 3d987985ff
Signed by: mpk
GPG Key ID: 035869C949377C5C
2 changed files with 19 additions and 0 deletions

View File

@ -11,6 +11,8 @@ import envoy.client.util.IconUtil;
import envoy.data.User;
/**
* Displays a user as a quickSelectControl which is used in the quickSelectList.
*
* @author Maximilian Käfer
* @since Envoy Client v0.3-beta
*/
@ -18,6 +20,13 @@ public class QuickSelectControl extends VBox {
User user;
/**
* Creates an instance of the {@link QuickSelectControl}.
*
* @param user the user whose data is used to create this instance.
* @param tab the parent tab ({@link GroupCreationTab}).
* @since Envoy Client v0.3-beta
*/
public QuickSelectControl(User user, GroupCreationTab tab) {
this.user = user;
setPadding(new Insets(1, 0, 0, 0));
@ -75,5 +84,9 @@ public class QuickSelectControl extends VBox {
getStyleClass().add("quick-select");
}
/**
* @return the user whose data is used in this instance.
* @since Envoy Client v0.3-beta
*/
public User getUser() { return user; }
}

View File

@ -164,6 +164,12 @@ public class GroupCreationTab implements EventListener {
return localDB.getChats().stream().map(Chat::getRecipient).filter(Group.class::isInstance).map(Contact::getName).anyMatch(newName::equals);
}
/**
* Removes an element from the quickSelectList.
*
* @param element the element to be removed.
* @since Envoy Client v0.3-beta
*/
public void removeFromQuickSelection(QuickSelectControl element) {
quickSelectList.getItems().remove(element);
userList.getItems().add(element.getUser());