adapt comparators to new model.compare structure (cont.)
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / descriptiveDataSet / matrix / quantitative / QuantitativeDataEditModeDisplayConverter.java
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.descriptiveDataSet.matrix.quantitative;
10
11 import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
12
13 import eu.etaxonomy.cdm.model.description.QuantitativeData;
14
15 /**
16 * Converts QuantitativeData of one cell of the character matrix to a String.
17 *
18 * @author pplitzner
19 * @since Dec 1, 2017
20 *
21 */
22 public class QuantitativeDataEditModeDisplayConverter extends DisplayConverter {
23
24 @Override
25 public Object canonicalToDisplayValue(Object canonicalValue) {
26 if(canonicalValue instanceof QuantitativeData){
27 return canonicalValue;
28 }
29 if(canonicalValue!=null){
30 return canonicalValue.toString();
31 }
32 return null;
33 }
34
35 @Override
36 public Object displayToCanonicalValue(Object displayValue) {
37 return displayValue;
38 }
39
40 }