Quick Select Support for the GroupCreationTab #77

Merged
mpk merged 9 commits from f/quick-group-select into develop 2020-10-04 21:28:57 +02:00
2 changed files with 19 additions and 0 deletions
Showing only changes of commit 3d987985ff - Show all commits

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.
mpk marked this conversation as resolved Outdated
Outdated
Review
... a {@link User} as ...
``` ... a {@link User} as ... ```
Outdated
Review

We don't use camelCase is Javadoc.

We don't use camelCase is Javadoc.
*
* @author Maximilian Käfer
* @since Envoy Client v0.3-beta
*/
@ -18,6 +20,13 @@ public class QuickSelectControl extends VBox {
User user;
mpk marked this conversation as resolved Outdated
Outdated
Review

Please make this private.

Please make this `private`.
/**
* Creates an instance of the {@link QuickSelectControl}.
mpk marked this conversation as resolved Outdated
Outdated
Review

As I've already been conditioned by a certain member of the Envoy team (the coffee machine guy) to not use @link in constructors for the own component, I've since swapped to using @code, so maybe you should too.

It might be beneficial to create a convention for such cases from here on.

As I've already been conditioned by a certain member of the Envoy team (the coffee machine guy) to not use `@link` in constructors for the own component, I've since swapped to using `@code`, so maybe you should too. It might be beneficial to create a convention for such cases from here on.
*
* @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));
mpk marked this conversation as resolved Outdated
Outdated
Review

?

?
Outdated
Review

This centers the component (it is just 1 pixel but very noticable)

This centers the component (it is just 1 pixel but very noticable)
@ -75,5 +84,9 @@ public class QuickSelectControl extends VBox {
getStyleClass().add("quick-select");
}
/**
* @return the user whose data is used in this instance.
mpk marked this conversation as resolved Outdated
Outdated
Review

The dot at the end is unnecessary.

The dot at the end is unnecessary.
* @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());