8 |
8 |
*/
|
9 |
9 |
package eu.etaxonomy.taxeditor.ui.section.classification;
|
10 |
10 |
|
|
11 |
import java.util.Collection;
|
|
12 |
import java.util.Collections;
|
|
13 |
import java.util.List;
|
|
14 |
import java.util.Map;
|
|
15 |
|
11 |
16 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
|
12 |
17 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
13 |
18 |
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
|
14 |
19 |
import eu.etaxonomy.taxeditor.newWizard.IWizardPageListener;
|
|
20 |
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
|
|
21 |
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
|
15 |
22 |
import eu.etaxonomy.taxeditor.store.CdmStore;
|
16 |
23 |
|
17 |
24 |
/**
|
... | ... | |
19 |
26 |
* @date 23.03.2016
|
20 |
27 |
*
|
21 |
28 |
*/
|
22 |
|
public class EditTaxonNodeWizard extends AbstractEditWizard<TaxonNode> {
|
|
29 |
public class EditTaxonNodeWizard extends AbstractEditWizard<TaxonNode> implements ICdmEntitySessionEnabled{
|
23 |
30 |
|
24 |
31 |
private TaxonNodeWizardPage taxonNodePage;
|
25 |
32 |
private IWizardPageListener wizardPageListener;
|
|
33 |
private ICdmEntitySession cdmEntitySession;
|
|
34 |
|
26 |
35 |
|
27 |
36 |
/* (non-Javadoc)
|
28 |
37 |
* @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#getEntityName()
|
... | ... | |
60 |
69 |
@Override
|
61 |
70 |
public void setEntity(TaxonNode entity) {
|
62 |
71 |
setWindowTitle(String.format("Edit %s", getEntityName()));
|
|
72 |
if (CdmStore.isActive() && cdmEntitySession == null) {
|
|
73 |
|
|
74 |
cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
|
|
75 |
cdmEntitySession.bind();
|
|
76 |
}
|
63 |
77 |
entity = CdmStore.getService(ITaxonNodeService.class).load(entity.getUuid());
|
64 |
78 |
super.setEntity(entity);
|
65 |
79 |
}
|
66 |
80 |
|
|
81 |
/**
|
|
82 |
* {@inheritDoc}
|
|
83 |
*/
|
|
84 |
@Override
|
|
85 |
public ICdmEntitySession getCdmEntitySession() {
|
|
86 |
|
|
87 |
return cdmEntitySession;
|
|
88 |
}
|
|
89 |
|
|
90 |
/**
|
|
91 |
* {@inheritDoc}
|
|
92 |
*/
|
|
93 |
@Override
|
|
94 |
public Collection<TaxonNode> getRootEntities() {
|
|
95 |
return Collections.singleton(this.getEntity());
|
|
96 |
}
|
|
97 |
|
|
98 |
/**
|
|
99 |
* {@inheritDoc}
|
|
100 |
*/
|
|
101 |
@Override
|
|
102 |
public Map<Object, List<String>> getPropertyPathsMap() {
|
|
103 |
// TODO Auto-generated method stub
|
|
104 |
return null;
|
|
105 |
}
|
|
106 |
|
67 |
107 |
|
68 |
108 |
|
69 |
109 |
}
|
ref #8088: fix TOE in edit taxon node wizard when changing taxon