Project

General

Profile

Download (1.63 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 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

    
11
package eu.etaxonomy.taxeditor.singlesource.navigation.navigator;
12

    
13
import org.apache.log4j.Logger;
14
import org.eclipse.jface.viewers.ColumnLabelProvider;
15
import org.eclipse.jface.viewers.ILabelProvider;
16
import org.eclipse.swt.graphics.Image;
17
import org.eclipse.ui.navigator.IDescriptionProvider;
18

    
19
import eu.etaxonomy.cdm.model.taxon.Synonym;
20

    
21
/**
22
 * @author p.ciardelli
23
 * @created 02.06.2009
24
 * @version 1.0
25
 */
26
/**
27
 * <p>SynonymLabelProvider class.</p>
28
 *
29
 * @author p.ciardelli
30
 * @created 04.06.2009
31
 * @version 1.0
32
 */
33
public class SynonymLabelProvider extends ColumnLabelProvider 
34
		implements ILabelProvider, IDescriptionProvider {
35
	private static final Logger logger = Logger
36
			.getLogger(SynonymLabelProvider.class);
37
	
38
	/** {@inheritDoc} */
39
	public Image getImage(Object element) {
40
		return null;
41
	}
42

    
43
	/** {@inheritDoc} */
44
	public String getText(Object element) {
45
		if (element instanceof Synonym &&
46
				((Synonym) element).getName() != null) {
47
			
48
			return "= " + ((Synonym) element).getName().getTitleCache();
49
		}
50
		return new String();
51
	}	
52
	
53
	/* (non-Javadoc)
54
	 * @see org.eclipse.ui.navigator.IDescriptionProvider#getDescription(java.lang.Object)
55
	 */
56
	/** {@inheritDoc} */
57
	public String getDescription(Object anElement) {
58
		if (anElement instanceof Synonym) {
59
			Synonym data = (Synonym) anElement;
60
			return "Synonym: " + data.getTitleCache(); //$NON-NLS-1$
61
		}
62
		return null;
63
	}
64
}
(2-2/3)