Project

General

Profile

Download (1.54 KB) Statistics
| Branch: | Tag: | Revision:
1 a60842d7 n.hoffmann
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4 2e93b829 Cherian Mathew
* European Distributed Institute of Taxonomy
5 a60842d7 n.hoffmann
* http://www.e-taxonomy.eu
6 2e93b829 Cherian Mathew
*
7 a60842d7 n.hoffmann
* 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.IGroupService;
14
import eu.etaxonomy.cdm.model.common.Group;
15
import eu.etaxonomy.taxeditor.store.CdmStore;
16
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailWizardPage;
17
18
/**
19
 * @author n.hoffmann
20
 * @created Mar 10, 2011
21
 * @version 1.0
22
 */
23
public class NewGroupWizard extends AbstractNewEntityWizard<Group> {
24
25
	private GroupDetailWizardPage groupPage;
26 2e93b829 Cherian Mathew
27 a60842d7 n.hoffmann
	/* (non-Javadoc)
28
	 * @see org.eclipse.jface.wizard.Wizard#addPages()
29
	 */
30
	@Override
31
	public void addPages() {
32
		groupPage = new GroupDetailWizardPage(formFactory, getConversationHolder(), getEntity());
33
		super.addPage(groupPage);
34
	}
35 2e93b829 Cherian Mathew
36 a60842d7 n.hoffmann
	/* (non-Javadoc)
37
	 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#saveEntity()
38
	 */
39
	@Override
40
	protected void saveEntity() {
41 fce7d237 Cherian Mathew
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
42
	        CdmStore.getService(IGroupService.class).merge(getEntity(), true);
43
	    } else {
44
	        CdmStore.getService(IGroupService.class).save(getEntity());
45
	    }
46 a60842d7 n.hoffmann
	}
47
48
	/* (non-Javadoc)
49
	 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#createNewEntity()
50
	 */
51
	@Override
52
	protected Group createNewEntity() {
53
		return Group.NewInstance();
54
	}
55
56 38f1558f n.hoffmann
	@Override
57
	protected String getEntityName() {
58
		return "Group";
59
	}
60
61 a60842d7 n.hoffmann
}