01: /*******************************************************************************
02: * Copyright (c) 2006, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.views.markers.internal;
11:
12: import org.eclipse.jface.viewers.ColumnLabelProvider;
13: import org.eclipse.swt.graphics.Image;
14:
15: /**
16: * The MarkerViewLabelProvider is a label provider for an individual field.
17: *
18: * @since 3.3
19: *
20: */
21: public class MarkerViewLabelProvider extends ColumnLabelProvider {
22:
23: IField field;
24:
25: /**
26: * Create a MarkerViewLabelProvider on a field
27: *
28: * @param field
29: */
30: MarkerViewLabelProvider(IField field) {
31: this .field = field;
32:
33: }
34:
35: /*
36: * (non-Javadoc)
37: *
38: * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
39: */
40: public String getText(Object element) {
41: return field.getValue(element);
42: }
43:
44: /*
45: * (non-Javadoc)
46: *
47: * @see org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
48: */
49: public Image getImage(Object element) {
50: return field.getImage(element);
51: }
52:
53: }
|