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
.agent
;
13 import java
.util
.Collection
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
23 * <p>TeamMemberSection class.</p>
26 * @created Apr 30, 2010
29 public class TeamMemberSection
extends AbstractUnboundEntityCollectionSection
<Team
, Person
> {
31 private boolean isNomenclaturalTeam
= false;
34 * <p>Constructor for TeamMemberSection.</p>
36 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
37 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
41 public TeamMemberSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
, int style
, boolean isNomenclatural
) {
42 super(cdmFormFactory
, conversation
, parentElement
, null, style
);
43 isNomenclaturalTeam
= isNomenclatural
;
48 public String
getTitleString() {
49 return "Team Members";
54 public void addElement(Person element
) {
55 getEntity().addTeamMember(element
);
60 public Person
createNewElement() {
61 return Person
.NewTitledInstance("");
66 public String
getEmptyString() {
67 return "No persons yet.";
72 protected String
getTooltipString() {
73 return "Add a member to this team";
78 public void removeElement(Person element
) {
79 getEntity().removeTeamMember(element
);
83 protected Collection
<Person
> getEntityCollection(Team entity
) {
84 return getEntity().getTeamMembers();
90 public boolean isNomenclaturalTeam() {
91 return isNomenclaturalTeam
;