1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2013 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.taxeditor.ui.campanula.derivatesearch;
|
11
|
|
12
|
import org.eclipse.jface.viewers.ColumnLabelProvider;
|
13
|
import org.eclipse.swt.graphics.Color;
|
14
|
|
15
|
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
|
16
|
|
17
|
/**
|
18
|
* @author pplitzner
|
19
|
* @date 25.11.2013
|
20
|
*
|
21
|
*/
|
22
|
public class DerivateSearchResultsLabelProvider extends ColumnLabelProvider {
|
23
|
|
24
|
/** {@inheritDoc} */
|
25
|
@Override
|
26
|
public String getText(Object element) {
|
27
|
if(element instanceof UuidAndTitleCache){
|
28
|
return ((UuidAndTitleCache) element).getTitleCache();
|
29
|
}
|
30
|
return element.toString();
|
31
|
}
|
32
|
|
33
|
/* (non-Javadoc)
|
34
|
* @see org.eclipse.jface.viewers.ColumnLabelProvider#getBackground(java.lang.Object)
|
35
|
*/
|
36
|
/** {@inheritDoc} */
|
37
|
@Override
|
38
|
public Color getBackground(Object element) {
|
39
|
return super.getBackground(element);
|
40
|
}
|
41
|
|
42
|
/* (non-Javadoc)
|
43
|
* @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
|
44
|
*
|
45
|
* does not seem t work right now
|
46
|
*/
|
47
|
/** {@inheritDoc} */
|
48
|
@Override
|
49
|
public String getToolTipText(Object element) {
|
50
|
return "Name: " + element.toString();
|
51
|
}
|
52
|
|
53
|
}
|