2 * Copyright (C) 2016 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.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.classification
;
11 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonNodeService
;
12 import eu
.etaxonomy
.cdm
.model
.taxon
.ITaxonTreeNode
;
13 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
14 import eu
.etaxonomy
.cdm
.persistence
.dto
.MergeResult
;
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 MergeResult result
= CdmStore
.getService(ITaxonNodeService
.class).merge(node
, true);
48 public void addPages() {
49 taxonNodePage
= new TaxonNodeWizardPage(formFactory
, getConversationHolder(), getEntity(), wizardPageListener
, false);
51 addPage(taxonNodePage
);
54 public void addWizardPageListener(IWizardPageListener wizardPageListener
){
55 this.wizardPageListener
= wizardPageListener
;
59 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#setEntity(java.lang.Object)
62 public void setEntity(ITaxonTreeNode entity
) {
63 setWindowTitle(String
.format("Edit %s", getEntityName()));
64 entity
= CdmStore
.getService(ITaxonNodeService
.class).load(entity
.getUuid());
65 super.setEntity(entity
);