KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > eclipse > console > views > ConfigurationsLabelProvider


1 package org.hibernate.eclipse.console.views;
2
3
4 import org.eclipse.jface.viewers.ILabelProvider;
5 import org.eclipse.jface.viewers.ILabelProviderListener;
6 import org.eclipse.swt.graphics.Image;
7 import org.hibernate.eclipse.console.utils.EclipseImages;
8 import org.hibernate.console.node.BaseNode;
9
10 public class ConfigurationsLabelProvider implements ILabelProvider {
11     
12     /**
13      * @see org.eclipse.jface.viewers.ILabelProvider#getImage(Object)
14      */

15     public Image getImage(Object JavaDoc element) {
16        if (element != null && element instanceof BaseNode) {
17             return EclipseImages.getImage(((BaseNode) element).getIconName());
18         } else {
19             return null;
20         }
21         }
22
23     /**
24      * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object)
25      */

26     public String JavaDoc getText(Object JavaDoc element) {
27         if (element != null && element instanceof BaseNode) {
28             String JavaDoc labelName = ((BaseNode) element).getName();
29             return labelName;
30         } else {
31             return element == null ? "<<empty>>" : element.toString();
32         }
33     }
34
35     /**
36      * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(ILabelProviderListener)
37      */

38     public void addListener(ILabelProviderListener listener) {
39     }
40
41     /**
42      * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
43      */

44     public void dispose() {
45     }
46
47     /**
48      * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(Object, String)
49      */

50     public boolean isLabelProperty(Object JavaDoc element, String JavaDoc property) {
51         return false;
52     }
53
54     /**
55      * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(ILabelProviderListener)
56      */

57     public void removeListener(ILabelProviderListener listener) {
58     }
59     
60 }
Popular Tags