1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.taxeditor.section.agent;
|
12
|
|
13
|
import java.util.Collection;
|
14
|
|
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.forms.CdmFormFactory;
|
19
|
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
|
20
|
import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection;
|
21
|
|
22
|
/**
|
23
|
* <p>TeamMemberSection class.</p>
|
24
|
*
|
25
|
* @author n.hoffmann
|
26
|
* @created Apr 30, 2010
|
27
|
* @version 1.0
|
28
|
*/
|
29
|
public class TeamMemberSection extends AbstractEntityCollectionSection<Team, Person> {
|
30
|
|
31
|
/**
|
32
|
* <p>Constructor for TeamMemberSection.</p>
|
33
|
*
|
34
|
* @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
|
35
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
36
|
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
|
37
|
* @param style a int.
|
38
|
*/
|
39
|
public TeamMemberSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
|
40
|
super(cdmFormFactory, conversation, parentElement, null, style);
|
41
|
}
|
42
|
|
43
|
/** {@inheritDoc} */
|
44
|
@Override
|
45
|
public String getTitleString() {
|
46
|
return "Team Members";
|
47
|
}
|
48
|
|
49
|
/** {@inheritDoc} */
|
50
|
@Override
|
51
|
public void addElement(Person element) {
|
52
|
getEntity().addTeamMember(element);
|
53
|
}
|
54
|
|
55
|
/** {@inheritDoc} */
|
56
|
@Override
|
57
|
public Person createNewElement() {
|
58
|
return Person.NewTitledInstance("");
|
59
|
}
|
60
|
|
61
|
/** {@inheritDoc} */
|
62
|
@Override
|
63
|
public Collection<Person> getCollection(Team entity) {
|
64
|
return getEntity().getTeamMembers();
|
65
|
}
|
66
|
|
67
|
/** {@inheritDoc} */
|
68
|
@Override
|
69
|
public String getEmptyString() {
|
70
|
return "No persons yet.";
|
71
|
}
|
72
|
|
73
|
/** {@inheritDoc} */
|
74
|
@Override
|
75
|
protected String getTooltipString() {
|
76
|
return "Add a membmer to this team";
|
77
|
}
|
78
|
|
79
|
/** {@inheritDoc} */
|
80
|
@Override
|
81
|
public void removeElement(Person element) {
|
82
|
getEntity().removeTeamMember(element);
|
83
|
}
|
84
|
|
85
|
|
86
|
}
|