2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.newWizard
;
12 import eu
.etaxonomy
.cdm
.api
.service
.IGrantedAuthorityService
;
13 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
14 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
15 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
16 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
17 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailWizardPage
;
20 * @author a.kohlbecker
21 * @created Sept 13 2012
23 public class NewGrantedAuthorityWizard
extends AbstractNewEntityWizard
<GrantedAuthorityImpl
> {
25 private GrantedAuthorityDetailWizardPage authorityPage
;
28 * @see org.eclipse.jface.wizard.Wizard#addPages()
31 public void addPages() {
32 authorityPage
= new GrantedAuthorityDetailWizardPage(formFactory
, getConversationHolder(), getEntity());
33 super.addPage(authorityPage
);
38 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#saveEntity()
41 protected void saveEntity() {
43 CdmStore
.getService(IGrantedAuthorityService
.class).merge(getEntity(), true);
45 MessagingUtils
.informationDialog(Messages
.NewGrantedAuthority_AlreadyInDb
, Messages
.NewGrantedAuthority_AlreadyInDb
);
51 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#createNewEntity()
54 protected GrantedAuthorityImpl
createNewEntity() {
55 return GrantedAuthorityImpl
.NewInstance("");
59 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#getEntityName()
62 protected String
getEntityName() {
63 return "GrantedAuthority";