3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.newWizard
;
13 import eu
.etaxonomy
.cdm
.api
.service
.IGrantedAuthorityService
;
14 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
15 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
16 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailWizardPage
;
19 * @author a.kohlbecker
20 * @created Sept 13 2012
22 public class NewGrantedAuthorityWizard
extends AbstractNewEntityWizard
<GrantedAuthorityImpl
> {
24 private GrantedAuthorityDetailWizardPage authorityPage
;
27 * @see org.eclipse.jface.wizard.Wizard#addPages()
30 public void addPages() {
31 authorityPage
= new GrantedAuthorityDetailWizardPage(formFactory
, getConversationHolder(), getEntity());
32 super.addPage(authorityPage
);
37 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#saveEntity()
40 protected void saveEntity() {
41 if(CdmStore
.getCurrentSessionManager().isRemoting()) {
42 CdmStore
.getService(IGrantedAuthorityService
.class).merge(getEntity(), true);
44 CdmStore
.getService(IGrantedAuthorityService
.class).save(getEntity());
49 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#createNewEntity()
52 protected GrantedAuthorityImpl
createNewEntity() {
53 return GrantedAuthorityImpl
.NewInstance();
57 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#getEntityName()
60 protected String
getEntityName() {
61 return "GrantedAuthority";