Project

General

Profile

Download (1.89 KB) Statistics
| Branch: | Tag: | Revision:
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.newWizard;
12

    
13
import eu.etaxonomy.cdm.api.service.IAgentService;
14
import eu.etaxonomy.cdm.model.agent.Team;
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
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
54
	        CdmStore.getService(IAgentService.class).merge(getEntity(), true);
55
	    } else {
56
	        CdmStore.getService(IAgentService.class).save(getEntity());
57
	    }
58
	}
59

    
60
	@Override
61
	protected String getEntityName() {
62
		return "Team";
63
	}
64

    
65
    /**
66
     * @return the isNomenclaturalTeam
67
     */
68
    public boolean isNomenclaturalTeam() {
69
        return isNomenclaturalTeam;
70
    }
71

    
72
    /**
73
     * @param isNomenclaturalTeam the isNomenclaturalTeam to set
74
     */
75
    public void setNomenclaturalTeam(boolean isNomenclaturalTeam) {
76
        this.isNomenclaturalTeam = isNomenclaturalTeam;
77
    }
78
}
(20-20/23)