1
|
/**
|
2
|
* Copyright (C) 2009 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.definedterm;
|
10
|
|
11
|
import org.eclipse.jface.viewers.ColumnLabelProvider;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.common.TermVocabulary;
|
14
|
import eu.etaxonomy.cdm.persistence.dto.TermDto;
|
15
|
import eu.etaxonomy.cdm.remote.l10n.TermRepresentation_L10n;
|
16
|
|
17
|
/**
|
18
|
*
|
19
|
* @author pplitzner
|
20
|
* @since Oct 29, 2018
|
21
|
*
|
22
|
*/
|
23
|
public class TermDtoLabelProvider extends ColumnLabelProvider {
|
24
|
|
25
|
@Override
|
26
|
public String getText(Object element) {
|
27
|
if(element instanceof TermVocabulary){
|
28
|
return ((TermVocabulary) element).getTitleCache();
|
29
|
}
|
30
|
else if(element instanceof TermDto){
|
31
|
TermDto termDto = (TermDto) element;
|
32
|
termDto.localize(new TermRepresentation_L10n());
|
33
|
return termDto.getRepresentation_L10n();
|
34
|
}
|
35
|
return element.toString();
|
36
|
}
|
37
|
|
38
|
}
|