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 the label of a given element. 18 * Used by most structured viewers, except table viewers. 19 */ 20 public interface ILabelProvider extends IBaseLabelProvider { 21 /** 22 * Returns the image for the label of the given element. The image 23 * is owned by the label provider and must not be disposed directly. 24 * Instead, dispose the label provider when no longer needed. 25 * 26 * @param element the element for which to provide the label image 27 * @return the image used to label the element, or <code>null</code> 28 * if there is no image for the given object 29 */ 30 public Image getImage(Object element); 31 32 /** 33 * Returns the text for the label of the given element. 34 * 35 * @param element the element for which to provide the label text 36 * @return the text string used to label the element, or <code>null</code> 37 * if there is no text label for the given object 38 */ 39 public String getText(Object element); 40 } 41