1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 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 package org.eclipse.jface.viewers; 12 13 import org.eclipse.swt.graphics.Image; 14 15 /** 16 * Extends <code>IBaseLabelProvider</code> with the methods 17 * to provide the text and/or image for each column of a given element. 18 * Used by table viewers. 19 * 20 * @see TableViewer 21 */ 22 public interface ITableLabelProvider extends IBaseLabelProvider { 23 /** 24 * Returns the label image for the given column of the given element. 25 * 26 * @param element the object representing the entire row, or 27 * <code>null</code> indicating that no input object is set 28 * in the viewer 29 * @param columnIndex the zero-based index of the column in which 30 * the label appears 31 * @return Image or <code>null</code> if there is no image for the 32 * given object at columnIndex 33 */ 34 public Image getColumnImage(Object element, int columnIndex); 35 36 /** 37 * Returns the label text for the given column of the given element. 38 * 39 * @param element the object representing the entire row, or 40 * <code>null</code> indicating that no input object is set 41 * in the viewer 42 * @param columnIndex the zero-based index of the column in which the label appears 43 * @return String or or <code>null</code> if there is no text for the 44 * given object at columnIndex 45 */ 46 public String getColumnText(Object element, int columnIndex); 47 } 48