1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.taxeditor.newWizard;
|
11
|
|
12
|
import eu.etaxonomy.cdm.api.service.IAgentService;
|
13
|
import eu.etaxonomy.cdm.model.agent.Team;
|
14
|
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
|
15
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
16
|
import eu.etaxonomy.taxeditor.ui.section.agent.TeamWizardPage;
|
17
|
|
18
|
/**
|
19
|
* <p>NewTeamWizard class.</p>
|
20
|
*
|
21
|
* @author n.hoffmann
|
22
|
* @created Jun 1, 2010
|
23
|
* @version 1.0
|
24
|
*/
|
25
|
public class NewTeamWizard extends AbstractNewEntityWizard<Team> {
|
26
|
|
27
|
private boolean isNomenclaturalTeam = false;
|
28
|
private boolean isCollectorTeam = false;
|
29
|
|
30
|
public NewTeamWizard() {}
|
31
|
|
32
|
public NewTeamWizard(boolean isNomenclaturalTeam, boolean isCollectorTeam) {
|
33
|
setNomenclaturalTeam(isNomenclaturalTeam);
|
34
|
setCollectorTeam(isCollectorTeam);
|
35
|
}
|
36
|
|
37
|
/** {@inheritDoc} */
|
38
|
@Override
|
39
|
public void addPages() {
|
40
|
addPage(new TeamWizardPage(formFactory, getEntity(), isNomenclaturalTeam, isCollectorTeam));
|
41
|
}
|
42
|
|
43
|
/* (non-Javadoc)
|
44
|
* @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
|
45
|
*/
|
46
|
/** {@inheritDoc} */
|
47
|
@Override
|
48
|
protected Team createNewEntity() {
|
49
|
return Team.NewInstance();
|
50
|
}
|
51
|
|
52
|
/** {@inheritDoc} */
|
53
|
@Override
|
54
|
protected void saveEntity() {
|
55
|
MergeResult result = CdmStore.getService(IAgentService.class).merge(getEntity(), true);
|
56
|
|
57
|
}
|
58
|
|
59
|
@Override
|
60
|
protected String getEntityName() {
|
61
|
return "Team";
|
62
|
}
|
63
|
|
64
|
/**
|
65
|
* @return the isNomenclaturalTeam
|
66
|
*/
|
67
|
public boolean isNomenclaturalTeam() {
|
68
|
return isNomenclaturalTeam;
|
69
|
}
|
70
|
|
71
|
/**
|
72
|
* @param isNomenclaturalTeam the isNomenclaturalTeam to set
|
73
|
*/
|
74
|
public void setNomenclaturalTeam(boolean isNomenclaturalTeam) {
|
75
|
this.isNomenclaturalTeam = isNomenclaturalTeam;
|
76
|
}
|
77
|
|
78
|
public boolean isCollectorTeam() {
|
79
|
return isCollectorTeam;
|
80
|
}
|
81
|
|
82
|
public void setCollectorTeam(boolean isCollectorTeam) {
|
83
|
this.isCollectorTeam = isCollectorTeam;
|
84
|
}
|
85
|
}
|