Project

General

Profile

Download (1.26 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.editor.workingSet.matrix.MatrixUtility;
15

    
16
/**
17
 * Converts QuantitativeData of one cell of the character matrix to a String.
18
 *
19
 * @author pplitzner
20
 * @since Dec 1, 2017
21
 *
22
 */
23
public class QuantitativeDataDisplayConverter extends DisplayConverter {
24

    
25
    /**
26
     * {@inheritDoc}
27
     */
28
    @Override
29
    public Object canonicalToDisplayValue(Object canonicalValue) {
30
        if(canonicalValue instanceof QuantitativeData){
31
            return MatrixUtility.getQuantitativeLabel((QuantitativeData) canonicalValue);
32
        }
33
        if(canonicalValue!=null){
34
            return canonicalValue.toString();
35
        }
36
        return null;
37
    }
38

    
39
    /**
40
     * {@inheritDoc}
41
     */
42
    @Override
43
    public Object displayToCanonicalValue(Object displayValue) {
44
        return null;
45
    }
46

    
47
}
(2-2/2)