4 package eu
.etaxonomy
.taxeditor
.ui
.section
.user
;
6 import java
.util
.Collection
;
7 import java
.util
.Comparator
;
9 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
10 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
11 import eu
.etaxonomy
.cdm
.model
.common
.User
;
12 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.GroupSelectionDialog
;
13 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
14 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
15 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
16 import eu
.etaxonomy
.taxeditor
.ui
.section
.DefaultCdmBaseComparator
;
22 public class GroupsByUserDetailSection
extends AbstractEntityCollectionSection
<User
, Group
> {
27 * @param parentElement
31 public GroupsByUserDetailSection(CdmFormFactory formFactory
,
32 ConversationHolder conversation
, ICdmFormElement parentElement
,
34 super(formFactory
, conversation
, parentElement
, "Groups", style
);
38 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
41 public Collection
<Group
> getCollection(User entity
) {
42 return entity
.getGroups();
46 public Comparator
<Group
> getComparator() {
47 return new DefaultCdmBaseComparator
<>();
51 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
54 public Group
createNewElement() {
55 Group selectedGroup
= GroupSelectionDialog
.select(getShell(), //getConversationHolder(),
61 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
64 public void addElement(Group element
) {
65 element
.addMember(getEntity());
69 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
72 public void removeElement(Group element
) {
73 element
.removeMember(getEntity());
77 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
80 public String
getEmptyString() {
81 return "No groups yet.";
85 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
88 protected String
getTooltipString() {
89 return "Add this user to a group";
96 public Group
addExisting() {
97 // TODO Auto-generated method stub
105 public boolean allowAddExisting() {
106 // TODO Auto-generated method stub