| /******************************************************************************* |
| * Copyright (c) 2006, 2007 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| |
| package org.eclipse.ui.views.markers.internal; |
| |
| import org.eclipse.jface.viewers.ColumnLabelProvider; |
| import org.eclipse.swt.graphics.Image; |
| |
| /** |
| * The MarkerViewLabelProvider is a label provider for an individual field. |
| * |
| * @since 3.3 |
| * |
| */ |
| public class MarkerViewLabelProvider extends ColumnLabelProvider { |
| |
| IField field; |
| |
| /** |
| * Create a MarkerViewLabelProvider on a field |
| * |
| * @param field |
| */ |
| MarkerViewLabelProvider(IField field) { |
| this.field = field; |
| |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object) |
| */ |
| public String getText(Object element) { |
| return field.getValue(element); |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object) |
| */ |
| public Image getImage(Object element) { |
| return field.getImage(element); |
| } |
| |
| |
| } |