From 3d987985ff721bc8c17c773f960b547752f9d3da Mon Sep 17 00:00:00 2001 From: DieGurke Date: Sat, 3 Oct 2020 15:19:37 +0200 Subject: [PATCH] Added javadoc --- .../envoy/client/ui/control/QuickSelectControl.java | 13 +++++++++++++ .../client/ui/controller/GroupCreationTab.java | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java b/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java index 617cd53..b5d95a7 100644 --- a/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java +++ b/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java @@ -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; } } diff --git a/client/src/main/java/envoy/client/ui/controller/GroupCreationTab.java b/client/src/main/java/envoy/client/ui/controller/GroupCreationTab.java index 82a24af..2bd09cc 100644 --- a/client/src/main/java/envoy/client/ui/controller/GroupCreationTab.java +++ b/client/src/main/java/envoy/client/ui/controller/GroupCreationTab.java @@ -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());