Quick Select Support for the GroupCreationTab #77
@ -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
|
||||
*
|
||||
* @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
kske
commented
Please make this Please make this `private`.
|
||||
|
||||
/**
|
||||
* Creates an instance of the {@link QuickSelectControl}.
|
||||
mpk marked this conversation as resolved
Outdated
delvh
commented
As I've already been conditioned by a certain member of the Envoy team (the coffee machine guy) to not use 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
delvh
commented
? ?
mpk
commented
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
kske
commented
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; }
|
||||
}
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user
We don't use camelCase is Javadoc.