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
.application
.CdmApplicationState
;
13 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
;
14 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
.Action
;
15 import eu
.etaxonomy
.cdm
.api
.service
.IClassificationService
;
16 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
17 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
18 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationWizardPage
;
21 * <p>ClassificationWizard class.</p>
28 public class NewClassificationWizard
extends AbstractNewEntityWizard
<Classification
> {
30 private ClassificationWizardPage classificationWizardPage
;
33 * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#setEntity(java.lang.Object)
36 public void setEntity(Classification entity
) {
37 setWindowTitle(String
.format("Edit %s", getEntityName()));
38 entity
= CdmStore
.getService(IClassificationService
.class).load(entity
.getUuid());
39 super.setEntity(entity
);
43 public void addPages() {
44 classificationWizardPage
= new ClassificationWizardPage(formFactory
, getEntity());
45 addPage(classificationWizardPage
);
49 protected void saveEntity() {
50 //CdmStore.getService(IClassificationService.class).saveOrUpdate(getEntity());
51 Classification classification
= getEntity();
52 CdmStore
.getService(IClassificationService
.class).merge(getEntity(), true);
53 CdmApplicationState
.getCurrentDataChangeService()
54 .fireChangeEvent(new CdmChangeEvent(Action
.Create
, classification
, NewTaxonNodeWizard
.class), true);
60 protected Classification
createNewEntity() {
61 return Classification
.NewInstance(null);
65 protected String
getEntityName() {
66 return "Classification";