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
;
13 import java
.util
.Comparator
;
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
.DefaultCdmBaseComparator
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
24 * <p>TeamMemberSection class.</p>
27 * @created Apr 30, 2010
30 public class TeamMemberSection
extends AbstractUnboundEntityCollectionSection
<Team
, Person
> {
32 private boolean isNomenclaturalTeam
= false;
35 * <p>Constructor for TeamMemberSection.</p>
37 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
38 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
39 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
42 public TeamMemberSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
, int style
, boolean isNomenclatural
) {
43 super(cdmFormFactory
, conversation
, parentElement
, null, style
);
44 isNomenclaturalTeam
= isNomenclatural
;
49 public String
getTitleString() {
50 return "Team Members";
55 public void addElement(Person element
) {
56 getEntity().addTeamMember(element
);
61 public Person
createNewElement() {
62 return Person
.NewTitledInstance("");
67 public String
getEmptyString() {
68 return "No persons yet.";
73 protected String
getTooltipString() {
74 return "Add a member to this team";
79 public void removeElement(Person element
) {
80 getEntity().removeTeamMember(element
);
84 protected Collection
<Person
> getEntityCollection(Team entity
) {
85 return getEntity().getTeamMembers();
89 public Comparator
<Person
> getComparator() {
90 return new DefaultCdmBaseComparator
<>();
96 public boolean isNomenclaturalTeam() {
97 return isNomenclaturalTeam
;
104 public Person
addExisting() {
112 public boolean allowAddExisting() {