3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.group
;
13 import java
.util
.Collection
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
17 import eu
.etaxonomy
.cdm
.model
.common
.User
;
18 import eu
.etaxonomy
.taxeditor
.ui
.dialogs
.filteredSelection
.UserSelectionDialog
;
19 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.forms
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
25 * @created Mar 9, 2011
28 public class MemberDetailSection
extends AbstractEntityCollectionSection
<Group
, User
> {
33 * @param parentElement
37 public MemberDetailSection(CdmFormFactory formFactory
,
38 ConversationHolder conversation
, ICdmFormElement parentElement
,
40 super(formFactory
, conversation
, parentElement
, "Members", style
);
44 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
47 public Collection
<User
> getCollection(Group entity
) {
48 return entity
.getMembers();
52 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
55 public User
createNewElement() {
56 User selection
= UserSelectionDialog
.select(getLayoutComposite().getShell(), getConversationHolder(), null);
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";