Project

General

Profile

« Previous | Next » 

Revision fd711754

Added by Katja Luther almost 4 years ago

ref #8785: update descriptions in description list after merge

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixConfigLabelAccumulator.java
14 14
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
15 15
import org.eclipse.nebula.widgets.nattable.layer.cell.IConfigLabelAccumulator;
16 16

  
17
import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
17 18
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
18 19
import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
19 20
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
......
87 88
                }
88 89
            }
89 90
            //check for supplemental data
90
            if(!taxonRowWrapper.getDescription().getSources().isEmpty() && columnPosition==0){
91
            if(!taxonRowWrapper.getDescription().getDescription().getSources().isEmpty() && columnPosition==0){
91 92
                configLabels.addLabel(CharacterMatrix.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA);
92 93
            }
93 94
            configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DESCRIPTION);
......
151 152
    private boolean hasDefaultValue(Feature feature, RowWrapperDTO<?> rowWrapperDTO) {
152 153
        if(rowWrapperDTO instanceof SpecimenRowWrapperDTO
153 154
                && ((SpecimenRowWrapperDTO) rowWrapperDTO).getDefaultDescription()!=null){
154
            return hasDefaultValue(feature, ((SpecimenRowWrapperDTO)rowWrapperDTO).getDefaultDescription().getDescription());
155
            TaxonDescription taxDescription = (TaxonDescription)((SpecimenRowWrapperDTO)rowWrapperDTO).getDefaultDescription().getDescription().getDescription();
156
            return hasDefaultValue(feature, taxDescription);
155 157
        }
156 158
        else if(rowWrapperDTO instanceof TaxonRowWrapperDTO){
157 159
            TaxonRowWrapperDTO taxonRowWrapper = (TaxonRowWrapperDTO)rowWrapperDTO;
158
            Set<TaxonDescription> descriptions = taxonRowWrapper.getDescription().getTaxon().getDescriptions();
159
            for (TaxonDescription taxonDescription : descriptions) {
160
            Set<DescriptionBaseDto> descriptions = taxonRowWrapper.getTaxonDescriptions();
161
            for (DescriptionBaseDto taxonDescription : descriptions) {
160 162
                if(matrix.getDescriptiveDataSet().getDescriptions().contains(taxonDescription)
161
                        && taxonDescription.getTypes().contains(DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION)){
162
                    return hasDefaultValue(feature, taxonDescription);
163
                        && taxonDescription.getDescription().getTypes().contains(DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION)){
164
                    return hasDefaultValue(feature, (TaxonDescription)taxonDescription.getDescription());
163 165
                }
164 166
            }
165 167
        }

Also available in: Unified diff