Revision 795080d7
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java | ||
---|---|---|
23 | 23 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
24 | 24 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
25 | 25 |
import eu.etaxonomy.cdm.persistence.dto.MergeResult; |
26 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto; |
|
26 | 27 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
27 | 28 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
28 | 29 |
import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeDetailElement; |
... | ... | |
117 | 118 |
protected ITaxonTreeNode createNewEntity() { |
118 | 119 |
if(getSelection() != null){ |
119 | 120 |
Object selectedObject = getSelection().getFirstElement(); |
120 |
if(selectedObject instanceof ITaxonTreeNode){ |
|
121 |
ITaxonTreeNode treeNode = (ITaxonTreeNode) selectedObject; |
|
122 |
|
|
123 |
if(treeNode instanceof TaxonNode){ |
|
124 |
TaxonNode node = CdmStore.getService(ITaxonNodeService.class).load(treeNode.getUuid()); |
|
125 |
if(node.getTaxon()!=null){ |
|
126 |
//FIXME this taxon is not used. Do we need this call? |
|
127 |
Taxon taxon = (Taxon) CdmStore.getService(ITaxonService.class).load(node.getTaxon().getUuid()); |
|
128 |
} |
|
129 |
else if(node.getClassification()!=null){ |
|
130 |
return CdmStore.getService(IClassificationService.class).load(node.getClassification().getUuid()); |
|
131 |
} |
|
132 |
return node; |
|
121 |
if(selectedObject instanceof TaxonNodeDto){ |
|
122 |
TaxonNodeDto taxonNodeDto = (TaxonNodeDto) selectedObject; |
|
123 |
TaxonNode node = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeDto.getUuid()); |
|
124 |
if(node.getTaxon()!=null){ |
|
125 |
//FIXME this taxon is not used. Do we need this call? |
|
126 |
Taxon taxon = (Taxon) CdmStore.getService(ITaxonService.class).load(node.getTaxon().getUuid()); |
|
133 | 127 |
} |
128 |
else if(node.getClassification()!=null){ |
|
129 |
return CdmStore.getService(IClassificationService.class).load(node.getClassification().getUuid()); |
|
130 |
} |
|
131 |
return node; |
|
132 |
|
|
134 | 133 |
} |
135 | 134 |
} |
136 | 135 |
|
137 | 136 |
return null; |
138 | 137 |
} |
139 | 138 |
|
139 |
|
|
140 | 140 |
/** |
141 | 141 |
* <p>openInEditor</p> |
142 | 142 |
* |
Also available in: Unified diff
adapt newTaxonNodeWizard for TaxonNodeDto