3 * Copyright (C) 2016 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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.classification
;
12 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonNodeService
;
13 import eu
.etaxonomy
.cdm
.model
.taxon
.ITaxonTreeNode
;
14 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
15 import eu
.etaxonomy
.taxeditor
.newWizard
.IWizardPageListener
;
16 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
23 public class EditTaxonNodeWizard
extends AbstractEditWizard
<ITaxonTreeNode
> {
25 private TaxonNodeWizardPage taxonNodePage
;
26 private IWizardPageListener wizardPageListener
;
29 * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#getEntityName()
32 protected String
getEntityName() {
37 * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#saveEntity()
40 protected void saveEntity() {
41 getConversationHolder().bind();
42 TaxonNode node
= (TaxonNode
)getEntity();
44 CdmStore
.getService(ITaxonNodeService
.class).merge(node
, true);
47 public void addPages() {
48 taxonNodePage
= new TaxonNodeWizardPage(formFactory
, getConversationHolder(), getEntity(), wizardPageListener
, false);
50 addPage(taxonNodePage
);
53 public void addWizardPageListener(IWizardPageListener wizardPageListener
){
54 this.wizardPageListener
= wizardPageListener
;
58 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#setEntity(java.lang.Object)
61 public void setEntity(ITaxonTreeNode entity
) {
62 setWindowTitle(String
.format("Edit %s", getEntityName()));
63 entity
= CdmStore
.getService(ITaxonNodeService
.class).load(entity
.getUuid());
64 super.setEntity(entity
);