4 package eu
.etaxonomy
.taxeditor
.newWizard
;
6 import eu
.etaxonomy
.cdm
.api
.service
.IPolytomousKeyService
;
7 import eu
.etaxonomy
.cdm
.common
.CdmUtils
;
8 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
9 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
15 public class NewPolytomousKeyWizard
extends AbstractNewEntityWizard
<PolytomousKey
> {
17 private PolytomousKeyWizardPage polytomousKeyPage
;
20 public void addPages() {
21 polytomousKeyPage
= new PolytomousKeyWizardPage(formFactory
, getConversationHolder(), getEntity());
22 super.addPage(polytomousKeyPage
);
25 public String
getPolytomousKeyName() {
26 return polytomousKeyPage
.getPolytomousKeyName();
30 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
33 protected void saveEntity() {
34 if(CdmUtils
.isNotBlank(polytomousKeyPage
.getPolytomousKeyName())) {
35 CdmStore
.getService(IPolytomousKeyService
.class).merge(getEntity(), true);
40 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
43 protected PolytomousKey
createNewEntity() {
44 PolytomousKey pkey
= PolytomousKey
.NewInstance();
45 pkey
.setTitleCache("");
50 protected String
getEntityName() {
51 return "Polytomous Key";
55 public boolean canFinish() {
56 if(CdmUtils
.isBlank(polytomousKeyPage
.getPolytomousKeyName())) {
59 return super.canFinish();