Project

General

Profile

Download (1.63 KB) Statistics
| Branch: | Tag: | Revision:
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.IGrantedAuthorityService;
13
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
14
import eu.etaxonomy.taxeditor.store.CdmStore;
15
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailWizardPage;
16

    
17
/**
18
 * @author a.kohlbecker
19
 * @created Sept 13 2012
20
 */
21
public class NewGrantedAuthorityWizard extends AbstractNewEntityWizard<GrantedAuthorityImpl> {
22

    
23
	private GrantedAuthorityDetailWizardPage authorityPage;
24

    
25
	/* (non-Javadoc)
26
	 * @see org.eclipse.jface.wizard.Wizard#addPages()
27
	 */
28
	@Override
29
	public void addPages() {
30
		authorityPage = new GrantedAuthorityDetailWizardPage(formFactory, getConversationHolder(), getEntity());
31
		super.addPage(authorityPage);
32
	}
33

    
34

    
35
	/* (non-Javadoc)
36
	 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#saveEntity()
37
	 */
38
	@Override
39
	protected void saveEntity() {
40
	    CdmStore.getService(IGrantedAuthorityService.class).merge(getEntity(), true);
41
	   
42
	}
43

    
44
	/* (non-Javadoc)
45
	 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#createNewEntity()
46
	 */
47
	@Override
48
	protected GrantedAuthorityImpl createNewEntity() {
49
		return GrantedAuthorityImpl.NewInstance();
50
	}
51

    
52
	/* (non-Javadoc)
53
	 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#getEntityName()
54
	 */
55
	@Override
56
	protected String getEntityName() {
57
		return "GrantedAuthority";
58
	}
59
}
(10-10/23)