Revision a893ba13
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionColumnAccessor.java | ||
---|---|---|
15 | 15 |
import java.util.Map; |
16 | 16 |
import java.util.Set; |
17 | 17 |
|
18 |
import javax.inject.Inject; |
|
19 |
|
|
20 |
import org.eclipse.e4.core.services.events.IEventBroker; |
|
18 | 21 |
import org.eclipse.nebula.widgets.nattable.data.IColumnPropertyAccessor; |
19 | 22 |
|
20 | 23 |
import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO; |
... | ... | |
23 | 26 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm; |
24 | 27 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
25 | 28 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
29 |
import eu.etaxonomy.taxeditor.event.EventUtility; |
|
30 |
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants; |
|
26 | 31 |
|
27 | 32 |
|
28 | 33 |
/** |
... | ... | |
33 | 38 |
public class DistributionColumnAccessor implements IColumnPropertyAccessor<TaxonDistributionDTO> { |
34 | 39 |
private DistributionEditor editor; |
35 | 40 |
public static final String DEFAULT_ENTRY = ""; |
41 |
@Inject |
|
42 |
private IEventBroker eventBroker; |
|
36 | 43 |
|
37 | 44 |
public DistributionColumnAccessor(DistributionEditor editor) { |
38 | 45 |
this.editor = editor; |
... | ... | |
116 | 123 |
distributionMap = new HashMap(); |
117 | 124 |
editor.taxonDistributionMap.put(taxonWrapper.getTaxonUuid(),distributionMap); |
118 | 125 |
} |
126 |
Distribution dist = null; |
|
119 | 127 |
Set<DescriptionElementBase> distributions = distributionMap.get(area); |
120 | 128 |
if (distributions != null && !distributions.isEmpty()){ |
121 | 129 |
DescriptionElementBase desc = distributions.iterator().next(); |
... | ... | |
132 | 140 |
distributions = new HashSet(); |
133 | 141 |
distributionMap.put(area, distributions); |
134 | 142 |
} |
135 |
Distribution dist = Distribution.NewInstance(area, (PresenceAbsenceTerm)newValue);
|
|
143 |
dist = Distribution.NewInstance(area, (PresenceAbsenceTerm)newValue); |
|
136 | 144 |
Set<TaxonDescription> descs = taxonWrapper.getDescriptionsWrapper().getDescriptions(); |
137 | 145 |
TaxonDescription desc; |
138 | 146 |
if (descs.size() >= 1){ |
... | ... | |
145 | 153 |
editor.part.getCdmEntitySession().load(desc, true); |
146 | 154 |
distributions.add(dist); |
147 | 155 |
|
156 |
|
|
148 | 157 |
} |
149 | 158 |
|
159 |
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DETAILS, true); |
|
150 | 160 |
} |
151 | 161 |
|
152 | 162 |
} |
Also available in: Unified diff
ref #7854: update details view when editing status in distribu