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
.taxeditor
.newWizard
.IWizardPageListener
;
15 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
22 public class EditTaxonNodeWizard
extends AbstractEditWizard
<ITaxonTreeNode
> {
24 private TaxonNodeWizardPage taxonNodePage
;
25 private IWizardPageListener wizardPageListener
;
28 * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#getEntityName()
31 protected String
getEntityName() {
36 * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#saveEntity()
39 protected void saveEntity() {
40 getConversationHolder().bind();
41 TaxonNode node
= (TaxonNode
)getEntity();
43 CdmStore
.getService(ITaxonNodeService
.class).merge(node
, true);
46 public void addPages() {
47 taxonNodePage
= new TaxonNodeWizardPage(formFactory
, getConversationHolder(), getEntity(), wizardPageListener
, false);
49 addPage(taxonNodePage
);
52 public void addWizardPageListener(IWizardPageListener wizardPageListener
){
53 this.wizardPageListener
= wizardPageListener
;
57 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#setEntity(java.lang.Object)
60 public void setEntity(ITaxonTreeNode entity
) {
61 setWindowTitle(String
.format("Edit %s", getEntityName()));
62 entity
= CdmStore
.getService(ITaxonNodeService
.class).load(entity
.getUuid());
63 super.setEntity(entity
);