2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.group
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
16 import eu
.etaxonomy
.cdm
.model
.common
.User
;
17 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.UserSelectionDialog
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
24 * @created Mar 9, 2011
27 public class MemberDetailSection
extends AbstractEntityCollectionSection
<Group
, User
> {
32 * @param parentElement
36 public MemberDetailSection(CdmFormFactory formFactory
,
37 ConversationHolder conversation
, ICdmFormElement parentElement
,
39 super(formFactory
, conversation
, parentElement
, "Members", style
);
43 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
46 public Collection
<User
> getCollection(Group entity
) {
47 return entity
.getMembers();
51 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
54 public User
createNewElement() {
55 User selection
= UserSelectionDialog
.select(getLayoutComposite().getShell(), //getConversationHolder(),
61 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
64 public void addElement(User element
) {
65 getEntity().addMember(element
);
69 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
72 public void removeElement(User element
) {
73 getEntity().removeMember(element
);
77 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
80 public String
getEmptyString() {
81 return "No members yet.";
85 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
88 protected String
getTooltipString() {
89 return "Add a memeber to this group";
96 public User
addExisting() {
97 // TODO Auto-generated method stub
105 public boolean allowAddExisting() {
106 // TODO Auto-generated method stub