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
|
|
29
|
public NewTeamWizard() {}
|
30
|
|
31
|
public NewTeamWizard(boolean b) {
|
32
|
setNomenclaturalTeam(b);
|
33
|
}
|
34
|
|
35
|
/** {@inheritDoc} */
|
36
|
@Override
|
37
|
public void addPages() {
|
38
|
addPage(new TeamWizardPage(formFactory, getConversationHolder(), getEntity(), isNomenclaturalTeam));
|
39
|
}
|
40
|
|
41
|
/* (non-Javadoc)
|
42
|
* @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
|
43
|
*/
|
44
|
/** {@inheritDoc} */
|
45
|
@Override
|
46
|
protected Team createNewEntity() {
|
47
|
return Team.NewInstance();
|
48
|
}
|
49
|
|
50
|
/** {@inheritDoc} */
|
51
|
@Override
|
52
|
protected void saveEntity() {
|
53
|
MergeResult result = CdmStore.getService(IAgentService.class).merge(getEntity(), true);
|
54
|
|
55
|
}
|
56
|
|
57
|
@Override
|
58
|
protected String getEntityName() {
|
59
|
return "Team";
|
60
|
}
|
61
|
|
62
|
/**
|
63
|
* @return the isNomenclaturalTeam
|
64
|
*/
|
65
|
public boolean isNomenclaturalTeam() {
|
66
|
return isNomenclaturalTeam;
|
67
|
}
|
68
|
|
69
|
/**
|
70
|
* @param isNomenclaturalTeam the isNomenclaturalTeam to set
|
71
|
*/
|
72
|
public void setNomenclaturalTeam(boolean isNomenclaturalTeam) {
|
73
|
this.isNomenclaturalTeam = isNomenclaturalTeam;
|
74
|
}
|
75
|
}
|