Revision f638efaa
Added by Andreas Müller about 9 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesContentProvider.java | ||
---|---|---|
14 | 14 |
import java.util.Map; |
15 | 15 |
import java.util.Set; |
16 | 16 |
|
17 |
import eu.etaxonomy.cdm.api.service.ITermService; |
|
18 | 17 |
import eu.etaxonomy.cdm.model.common.Marker; |
19 | 18 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
20 | 19 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
21 | 20 |
import eu.etaxonomy.cdm.model.description.IDescribable; |
22 | 21 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
23 |
import eu.etaxonomy.taxeditor.editor.UsageTermCollection; |
|
24 | 22 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveContentProvider; |
25 | 23 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree; |
26 | 24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
25 |
import eu.etaxonomy.taxeditor.store.UsageTermCollection; |
|
27 | 26 |
|
28 | 27 |
/** |
29 | 28 |
* The class provides the required content to the Uses View |
... | ... | |
57 | 56 |
if(parentElement instanceof Taxon){ |
58 | 57 |
Taxon taxon = (Taxon) parentElement; |
59 | 58 |
this.markerTypes.addAll(CdmStore.getTermManager().getPreferredTerms(MarkerType.class)); |
60 |
for(DescriptionBase description : taxon.getDescriptions()){ |
|
59 |
for(DescriptionBase<?> description : taxon.getDescriptions()){
|
|
61 | 60 |
if(! description.isImageGallery()){ |
62 |
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType); |
|
63 |
Set<Marker> descriptionMarkers = description.getMarkers(); |
|
61 |
Set<Marker> descriptionMarkers = description.getMarkers(); |
|
64 | 62 |
if(descriptionMarkers != null) { |
65 | 63 |
for (Marker marker: descriptionMarkers) { |
66 |
if(marker.getMarkerType().equals(useMarkertype)) {
|
|
64 |
if(marker.getMarkerType() != null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
|
|
67 | 65 |
descriptions.add(description); |
68 | 66 |
} |
69 | 67 |
} |
Also available in: Unified diff
fix NPE bug and termloading bug for Usage Records #4247