Revision 97d21185
Added by Katja Luther almost 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditor.java | ||
---|---|---|
478 | 478 |
public List<DescriptionBase> getDistributions() { |
479 | 479 |
List<DescriptionBase> descriptions = new ArrayList(); |
480 | 480 |
|
481 |
// taxonList.forEach(taxonDto->taxonDto.getDistributionMap() |
|
482 |
// .forEach((area, descriptionElements)->descElements.addAll(descriptionElements))); |
|
483 |
|
|
484 | 481 |
taxonList.forEach(taxonDto -> taxonDto.getDescriptionsWrapper().getDescriptions().forEach(taxDesc -> descriptions.add(taxDesc))); |
485 | 482 |
|
486 | 483 |
for (DescriptionBase description: descriptions){ |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditorPart.java | ||
---|---|---|
21 | 21 |
import org.eclipse.core.runtime.IProgressMonitor; |
22 | 22 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
23 | 23 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
24 |
import org.eclipse.e4.ui.di.Focus; |
|
24 | 25 |
import org.eclipse.e4.ui.di.Persist; |
25 | 26 |
import org.eclipse.e4.ui.model.application.ui.MDirtyable; |
26 | 27 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
... | ... | |
34 | 35 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
35 | 36 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
36 | 37 |
import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO; |
37 |
import eu.etaxonomy.cdm.model.common.CdmBase;
|
|
38 |
import eu.etaxonomy.cdm.model.description.DescriptionBase;
|
|
38 | 39 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
39 | 40 |
import eu.etaxonomy.taxeditor.editor.IDistributionEditor; |
40 | 41 |
import eu.etaxonomy.taxeditor.model.IDirtyMarkable; |
... | ... | |
117 | 118 |
return selService; |
118 | 119 |
} |
119 | 120 |
|
121 |
@Focus |
|
122 |
public void setFocus(){ |
|
123 |
if(conversation!=null){ |
|
124 |
conversation.bind(); |
|
125 |
} |
|
126 |
if(cdmEntitySession != null) { |
|
127 |
cdmEntitySession.bind(); |
|
128 |
} |
|
129 |
} |
|
130 |
|
|
120 | 131 |
|
121 | 132 |
public DistributionEditor getEditor() { |
122 | 133 |
return editor; |
... | ... | |
158 | 169 |
* {@inheritDoc} |
159 | 170 |
*/ |
160 | 171 |
@Override |
161 |
public <T extends CdmBase> Collection<T> getRootEntities() {
|
|
162 |
// TODO Auto-generated method stub
|
|
163 |
return null; |
|
172 |
public List<DescriptionBase> getRootEntities() {
|
|
173 |
return editor.getDistributions();
|
|
174 |
|
|
164 | 175 |
} |
165 | 176 |
|
166 | 177 |
/** |
... | ... | |
204 | 215 |
@Persist |
205 | 216 |
@Override |
206 | 217 |
public void save(IProgressMonitor monitor) { |
207 |
//TODO: merge not save distributions |
|
208 |
|
|
209 | 218 |
CdmStore.getService(IDescriptionService.class).merge(editor.getDistributions(), true); |
210 | 219 |
|
211 | 220 |
conversation.commit(); |
212 |
updateResults = null; |
|
221 |
|
|
213 | 222 |
dirty.setDirty(false); |
214 | 223 |
} |
215 | 224 |
|
Also available in: Unified diff
ref #7854: minor changes in session handling