01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 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.jface.viewers;
11:
12: import org.eclipse.swt.graphics.Image;
13:
14: /**
15: * Extends <code>IBaseLabelProvider</code> with the methods
16: * to provide the text and/or image for the label of a given element.
17: * Used by most structured viewers, except table viewers.
18: */
19: public interface ILabelProvider extends IBaseLabelProvider {
20: /**
21: * Returns the image for the label of the given element. The image
22: * is owned by the label provider and must not be disposed directly.
23: * Instead, dispose the label provider when no longer needed.
24: *
25: * @param element the element for which to provide the label image
26: * @return the image used to label the element, or <code>null</code>
27: * if there is no image for the given object
28: */
29: public Image getImage(Object element);
30:
31: /**
32: * Returns the text for the label of the given element.
33: *
34: * @param element the element for which to provide the label text
35: * @return the text string used to label the element, or <code>null</code>
36: * if there is no text label for the given object
37: */
38: public String getText(Object element);
39: }
|