4 package eu
.etaxonomy
.taxeditor
.ui
.section
.user
;
6 import java
.util
.Collection
;
8 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
9 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
10 import eu
.etaxonomy
.cdm
.model
.common
.User
;
11 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.GroupSelectionDialog
;
12 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
13 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
14 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
20 public class GroupsByUserDetailSection
extends AbstractEntityCollectionSection
<User
, Group
> {
25 * @param parentElement
29 public GroupsByUserDetailSection(CdmFormFactory formFactory
,
30 ConversationHolder conversation
, ICdmFormElement parentElement
,
32 super(formFactory
, conversation
, parentElement
, "Groups", style
);
36 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
39 public Collection
<Group
> getCollection(User entity
) {
40 return entity
.getGroups();
44 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
47 public Group
createNewElement() {
48 Group selectedGroup
= GroupSelectionDialog
.select(getShell(), //getConversationHolder(),
54 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
57 public void addElement(Group element
) {
58 element
.addMember(getEntity());
62 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
65 public void removeElement(Group element
) {
66 element
.removeMember(getEntity());
70 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
73 public String
getEmptyString() {
74 return "No groups yet.";
78 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
81 protected String
getTooltipString() {
82 return "Add this user to a group";
89 public Group
addExisting() {
90 // TODO Auto-generated method stub
98 public boolean allowAddExisting() {
99 // TODO Auto-generated method stub