1
|
/**
|
2
|
* Copyright (C) 2018 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.view.checklist.e4;
|
10
|
|
11
|
import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.description.Distribution;
|
14
|
|
15
|
/**
|
16
|
* @author k.luther
|
17
|
* @since 05.12.2018
|
18
|
*
|
19
|
*/
|
20
|
public class StatusDisplayConverter extends DisplayConverter{
|
21
|
|
22
|
/**
|
23
|
* {@inheritDoc}
|
24
|
*/
|
25
|
@Override
|
26
|
public Object canonicalToDisplayValue(Object canonicalValue) {
|
27
|
if(canonicalValue instanceof Distribution){
|
28
|
Distribution distribution = (Distribution)canonicalValue;
|
29
|
String result = distribution.getStatus().getLabel();
|
30
|
|
31
|
return result;
|
32
|
}
|
33
|
|
34
|
else if(canonicalValue!=null){
|
35
|
return canonicalValue.toString();
|
36
|
}
|
37
|
return null;
|
38
|
}
|
39
|
|
40
|
/**
|
41
|
* {@inheritDoc}
|
42
|
*/
|
43
|
@Override
|
44
|
public Object displayToCanonicalValue(Object displayValue) {
|
45
|
return null;
|
46
|
}
|
47
|
|
48
|
}
|