KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > markers > internal > MarkerViewLabelProvider


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.views.markers.internal;
13
14 import org.eclipse.jface.viewers.ColumnLabelProvider;
15 import org.eclipse.swt.graphics.Image;
16
17 /**
18  * The MarkerViewLabelProvider is a label provider for an individual field.
19  *
20  * @since 3.3
21  *
22  */

23 public class MarkerViewLabelProvider extends ColumnLabelProvider {
24
25     IField field;
26
27     /**
28      * Create a MarkerViewLabelProvider on a field
29      *
30      * @param field
31      */

32     MarkerViewLabelProvider(IField field) {
33         this.field = field;
34
35     }
36
37     /*
38      * (non-Javadoc)
39      *
40      * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
41      */

42     public String JavaDoc getText(Object JavaDoc element) {
43         return field.getValue(element);
44     }
45
46     /*
47      * (non-Javadoc)
48      *
49      * @see org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
50      */

51     public Image getImage(Object JavaDoc element) {
52         return field.getImage(element);
53     }
54
55     
56 }
57
Popular Tags