Revision 6a45f6a2
Added by Alex Theys almost 12 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java | ||
---|---|---|
6 | 6 |
import java.util.ArrayList; |
7 | 7 |
import java.util.List; |
8 | 8 |
import java.util.Map; |
9 |
import java.util.Set; |
|
9 | 10 |
|
10 | 11 |
import org.eclipse.jface.viewers.ITreeContentProvider; |
11 | 12 |
import org.eclipse.jface.viewers.Viewer; |
12 | 13 |
|
14 |
import eu.etaxonomy.cdm.api.service.ITermService; |
|
15 |
import eu.etaxonomy.cdm.model.common.Marker; |
|
16 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
13 | 17 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
14 | 18 |
import eu.etaxonomy.cdm.model.description.Feature; |
15 | 19 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
16 | 20 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
17 | 21 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
18 | 22 |
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput; |
23 |
import eu.etaxonomy.taxeditor.editor.UsageTermCollection; |
|
19 | 24 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer; |
20 | 25 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree; |
21 | 26 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
27 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
22 | 28 |
import eu.etaxonomy.taxeditor.store.TermStore; |
23 | 29 |
|
24 | 30 |
/** |
... | ... | |
130 | 136 |
List<DescriptionBase> descriptions = new ArrayList<DescriptionBase>(); |
131 | 137 |
for(DescriptionBase description : taxon.getDescriptions()){ |
132 | 138 |
if(! description.isImageGallery()){ |
133 |
descriptions.add(description); |
|
139 |
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType); |
|
140 |
Set<Marker> descriptionMarkers = description.getMarkers(); |
|
141 |
if(descriptionMarkers != null && !descriptionMarkers.isEmpty()) { |
|
142 |
for (Marker marker: descriptionMarkers) { |
|
143 |
if(!(marker.getMarkerType().equals(useMarkertype))) { |
|
144 |
descriptions.add(description); |
|
145 |
} |
|
146 |
} |
|
147 |
} |
|
148 |
else { |
|
149 |
descriptions.add(description); |
|
150 |
} |
|
134 | 151 |
} |
152 |
|
|
135 | 153 |
} |
136 | 154 |
return descriptions; |
137 | 155 |
} |
Also available in: Unified diff
AT: committing changes to the TaxEditor Post second round of code review