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
|
if(canonicalValue!=null){
|
32
|
return canonicalValue.toString();
|
33
|
}
|
34
|
return null;
|
35
|
}
|
36
|
|
37
|
/**
|
38
|
* {@inheritDoc}
|
39
|
*/
|
40
|
@Override
|
41
|
public Object displayToCanonicalValue(Object displayValue) {
|
42
|
return null;
|
43
|
}
|
44
|
|
45
|
}
|