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: * A label decorator decorates the label text and image for some element.
16: * The original label text and image are obtained by some other means,
17: * for example by a label provider.
18: *
19: * @see ILabelProvider
20: */
21: public interface ILabelDecorator extends IBaseLabelProvider {
22: /**
23: * Returns an image that is based on the given image,
24: * but decorated with additional information relating to the state
25: * of the provided element.
26: *
27: * Text and image decoration updates can occur as a result of other updates
28: * within the workbench including deferred decoration by background processes.
29: * Clients should handle labelProviderChangedEvents for the given element to get
30: * the complete decoration.
31: * @see LabelProviderChangedEvent
32: * @see IBaseLabelProvider#addListener
33: *
34: * @param image the input image to decorate, or <code>null</code> if the element has no image
35: * @param element the element whose image is being decorated
36: * @return the decorated image, or <code>null</code> if no decoration is to be applied
37: *
38: * @see org.eclipse.jface.resource.CompositeImageDescriptor
39: */
40: public Image decorateImage(Image image, Object element);
41:
42: /**
43: * Returns a text label that is based on the given text label,
44: * but decorated with additional information relating to the state
45: * of the provided element.
46: *
47: * Text and image decoration updates can occur as a result of other updates
48: * within the workbench including deferred decoration by background processes.
49: * Clients should handle labelProviderChangedEvents for the given element to get
50: * the complete decoration.
51: * @see LabelProviderChangedEvent
52: * @see IBaseLabelProvider#addListener
53: *
54: * @param text the input text label to decorate
55: * @param element the element whose image is being decorated
56: * @return the decorated text label, or <code>null</code> if no decoration is to be applied
57: */
58: public String decorateText(String text, Object element);
59: }
|