Project

General

Profile

Download (1.07 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.editor.workingSet.matrix.quantitative;
10

    
11
import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
12

    
13
import eu.etaxonomy.cdm.model.description.QuantitativeData;
14
import eu.etaxonomy.taxeditor.model.DescriptionHelper;
15

    
16
/**
17
 * @author pplitzner
18
 * @since Dec 1, 2017
19
 *
20
 */
21
public class QuantitativeDataDisplayConverter extends DisplayConverter {
22

    
23
    /**
24
     * {@inheritDoc}
25
     */
26
    @Override
27
    public Object canonicalToDisplayValue(Object canonicalValue) {
28
        if(canonicalValue instanceof QuantitativeData){
29
            return DescriptionHelper.getLabel(canonicalValue);
30
        }
31
        return canonicalValue.toString();
32
    }
33

    
34
    /**
35
     * {@inheritDoc}
36
     */
37
    @Override
38
    public Object displayToCanonicalValue(Object displayValue) {
39
        return null;
40
    }
41

    
42
}
(3-3/3)