Revision 7a0547ca
Added by Patrick Plitzner over 10 years ago
- enabled DescriptiveView (Factual Data) to show descriptions of SpecimenOrObservationBase
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java | ||
---|---|---|
36 | 36 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
37 | 37 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
38 | 38 |
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode; |
39 |
import eu.etaxonomy.cdm.model.description.SpecimenDescription; |
|
39 | 40 |
import eu.etaxonomy.cdm.model.media.Media; |
40 | 41 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
41 | 42 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
... | ... | |
196 | 197 |
createTeamOrPersonBaseDetailSection(rootElement); |
197 | 198 |
|
198 | 199 |
} else if (input instanceof DescriptionBase) { |
199 |
Set<Marker> descriptionMarkers = ((DescriptionBase) input).getMarkers(); |
|
200 |
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find( |
|
201 |
UsageTermCollection.uuidUseMarkerType); |
|
202 |
Boolean isUseDescription = false; |
|
203 |
for (Marker marker : descriptionMarkers) { |
|
204 |
if (marker.getMarkerType().equals(useMarkertype)) { |
|
205 |
isUseDescription = true; |
|
206 |
} |
|
207 |
} |
|
208 |
if (((DescriptionBase) input).isImageGallery()) { |
|
209 |
createImageGallerySection(rootElement); |
|
210 |
|
|
211 |
} else if (isUseDescription) { |
|
212 |
createUseDescriptionSection(rootElement); |
|
213 |
} else { |
|
214 |
createDescriptionSection(rootElement); |
|
215 |
|
|
216 |
} |
|
200 |
if(input instanceof SpecimenDescription){ |
|
201 |
//TODO: add more sections to DetailsView for SpecimenDescription |
|
202 |
createSpecimenDescriptionSection(rootElement); |
|
203 |
} |
|
204 |
else{ |
|
205 |
Set<Marker> descriptionMarkers = ((DescriptionBase) input).getMarkers(); |
|
206 |
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find( |
|
207 |
UsageTermCollection.uuidUseMarkerType); |
|
208 |
Boolean isUseDescription = false; |
|
209 |
for (Marker marker : descriptionMarkers) { |
|
210 |
if (marker.getMarkerType().equals(useMarkertype)) { |
|
211 |
isUseDescription = true; |
|
212 |
} |
|
213 |
} |
|
214 |
if (((DescriptionBase) input).isImageGallery()) { |
|
215 |
createImageGallerySection(rootElement); |
|
216 |
|
|
217 |
} else if (isUseDescription) { |
|
218 |
createUseDescriptionSection(rootElement); |
|
219 |
} else { |
|
220 |
createDescriptionSection(rootElement); |
|
221 |
|
|
222 |
} |
|
223 |
} |
|
217 | 224 |
} else if (input instanceof DescriptionElementBase) { |
218 | 225 |
Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers(); |
219 | 226 |
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find( |
... | ... | |
508 | 515 |
addPart(scopeSection); |
509 | 516 |
} |
510 | 517 |
|
518 |
/** |
|
519 |
* createDescriptionSection |
|
520 |
* |
|
521 |
* @param parent |
|
522 |
*/ |
|
523 |
private void createSpecimenDescriptionSection(RootElement parent) { |
|
524 |
destroySections(); |
|
525 |
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
526 |
addPart(descriptionDetailSection); |
|
527 |
} |
|
528 |
|
|
511 | 529 |
/** |
512 | 530 |
* Creates the use Description section |
513 | 531 |
* |
Also available in: Unified diff