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
.agent
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
16 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
22 * <p>TeamMemberSection class.</p>
25 * @created Apr 30, 2010
28 public class TeamMemberSection
extends AbstractUnboundEntityCollectionSection
<Team
, Person
> {
30 private boolean isNomenclaturalTeam
= false;
33 * <p>Constructor for TeamMemberSection.</p>
35 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
36 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
40 public TeamMemberSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
, int style
, boolean isNomenclatural
) {
41 super(cdmFormFactory
, conversation
, parentElement
, null, style
);
42 isNomenclaturalTeam
= isNomenclatural
;
47 public String
getTitleString() {
48 return "Team Members";
53 public void addElement(Person element
) {
54 getEntity().addTeamMember(element
);
59 public Person
createNewElement() {
60 return Person
.NewTitledInstance("");
65 public String
getEmptyString() {
66 return "No persons yet.";
71 protected String
getTooltipString() {
72 return "Add a member to this team";
77 public void removeElement(Person element
) {
78 getEntity().removeTeamMember(element
);
82 protected Collection
<Person
> getEntityCollection(Team entity
) {
83 return getEntity().getTeamMembers();
89 public boolean isNomenclaturalTeam() {
90 return isNomenclaturalTeam
;