initial quantum version
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / view / subset / SubsetLabelProvider.java
1 package com.quantum.view.subset;
2
3 import com.quantum.view.bookmark.TreeNode;
4
5 import org.eclipse.jface.viewers.ILabelProvider;
6 import org.eclipse.jface.viewers.ILabelProviderListener;
7 import org.eclipse.swt.graphics.Image;
8
9 /**
10  * @author root
11  *
12  * Implements the ILabelProvider for the Bookmarks.
13  */
14 public class SubsetLabelProvider implements ILabelProvider {
15         /**
16          * @see org.eclipse.jface.viewers.ILabelProvider#getImage(Object)
17          */
18         public Image getImage(Object element) {
19             if (element instanceof TreeNode) {
20             return ((TreeNode) element).getImage();
21                 } else {
22                 return null;
23         }
24         }
25
26         /**
27          * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object)
28          */
29         public String getText(Object element) {
30                 if (element instanceof TreeNode) {
31                         return ((TreeNode) element).getLabelName();
32                 } else {
33             return element.toString();
34         }
35         }
36
37         /**
38          * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(ILabelProviderListener)
39          */
40         public void addListener(ILabelProviderListener listener) {
41         }
42
43         /**
44          * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
45          */
46         public void dispose() {
47         }
48
49         /**
50          * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(Object, String)
51          */
52         public boolean isLabelProperty(Object element, String property) {
53                 return false;
54         }
55
56         /**
57          * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(ILabelProviderListener)
58          */
59         public void removeListener(ILabelProviderListener listener) {
60      }
61 }