Project

General

Profile

Revision 9f8c59b4

ID9f8c59b42db35284a4d98f37ce8908cc0df53d43
Parent 5a9a799e
Child fb028abd

Added by Patrick Plitzner over 2 years ago

ref #7095 Simplify RowWrapper getDataValueForFeature()

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/RowWrapper.java
118 118

  
119 119
    public Object getDataValueForFeature(Feature feature){
120 120
        DescriptionElementBase descriptionElementBase = featureToElementMap.get(feature);
121
        if(descriptionElementBase!=null && descriptionElementBase.isInstanceOf(CategoricalData.class)){
122
            CategoricalData categoricalData = HibernateProxyHelper.deproxy(descriptionElementBase, CategoricalData.class);
123
            return categoricalData.getStatesOnly();
124
        }
125 121
        return descriptionElementBase;
126 122
    }
127 123

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/categorical/CategoricalDataDisplayConverter.java
14 14

  
15 15
import eu.etaxonomy.cdm.model.description.CategoricalData;
16 16
import eu.etaxonomy.cdm.model.description.State;
17
import eu.etaxonomy.taxeditor.model.DescriptionHelper;
18 17

  
19 18
/**
20 19
 * Converts CategoricalData and States of one cell of the character matrix to a
......
32 31
    @Override
33 32
    public Object canonicalToDisplayValue(Object canonicalValue) {
34 33
        if(canonicalValue instanceof CategoricalData){
35
            return DescriptionHelper.getLabel(canonicalValue);
34
            CategoricalData categoricalData = (CategoricalData)canonicalValue;
35
            String result = categoricalData.getStatesOnly().toString();
36
            result = result.substring(1, result.length() - 1);
37
            return result;
36 38
        }
37 39
        else if(canonicalValue instanceof State){
38 40
            return ((State) canonicalValue).getLabel();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)