|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.viewers.BaseLabelProvider
org.eclipse.jface.viewers.LabelProvider
org.eclipse.ui.model.WorkbenchLabelProvider
public class WorkbenchLabelProvider
Provides basic labels for adaptable objects that have the
IWorkbenchAdapter adapter associated with them. All dispensed
images are cached until the label provider is explicitly disposed.
This class provides a facility for subclasses to define annotations
on the labels and icons of adaptable objects.
| Constructor Summary | |
|---|---|
WorkbenchLabelProvider()
Creates a new workbench label provider. |
|
| Method Summary | |
|---|---|
protected ImageDescriptor |
decorateImage(ImageDescriptor input,
Object element)
Returns an image descriptor that is based on the given descriptor, but decorated with additional information relating to the state of the provided object. |
protected String |
decorateText(String input,
Object element)
Returns a label that is based on the given label, but decorated with additional information relating to the state of the provided object. |
void |
dispose()
The BaseLabelProvider implementation of this
IBaseLabelProvider method clears its internal listener list. |
protected IWorkbenchAdapter |
getAdapter(Object o)
Returns the implementation of IWorkbenchAdapter for the given object. |
protected IWorkbenchAdapter2 |
getAdapter2(Object o)
Returns the implementation of IWorkbenchAdapter2 for the given object. |
protected IWorkbenchAdapter3 |
getAdapter3(Object o)
Returns the implementation of IWorkbenchAdapter3 for the given object. |
Color |
getBackground(Object element)
Provides a background color for the given element. |
static ILabelProvider |
getDecoratingWorkbenchLabelProvider()
Returns a workbench label provider that is hooked up to the decorator mechanism. |
protected StyledString.Styler |
getDecorationStyle(Object element)
Sets the StyledString.Styler to be used
for string decorations. |
Font |
getFont(Object element)
Provides a font for the given element. |
Color |
getForeground(Object element)
Provides a foreground color for the given element. |
Image |
getImage(Object element)
The LabelProvider implementation of this
ILabelProvider method returns null. |
StyledString |
getStyledText(Object element)
The default implementation of this returns the styled text label for the given element. |
String |
getText(Object element)
The LabelProvider implementation of this
ILabelProvider method returns the element's
toString string. |
| Methods inherited from class org.eclipse.jface.viewers.BaseLabelProvider |
|---|
addListener, fireLabelProviderChanged, isLabelProperty, removeListener |
| Methods inherited from class org.eclipse.core.commands.common.EventManager |
|---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvider |
|---|
addListener, isLabelProperty, removeListener |
| Constructor Detail |
|---|
public WorkbenchLabelProvider()
| Method Detail |
|---|
public static ILabelProvider getDecoratingWorkbenchLabelProvider()
DecoratingLabelProvider which wraps a
new WorkbenchLabelProvider
protected ImageDescriptor decorateImage(ImageDescriptor input,
Object element)
input - The base image to decorate.element - The element used to look up decorations.
CompositeImageDescriptor
protected String decorateText(String input,
Object element)
input - The base text to decorate.element - The element used to look up decorations.
public void dispose()
BaseLabelProviderBaseLabelProvider implementation of this
IBaseLabelProvider method clears its internal listener list.
Subclasses may extend but should call the super implementation.
dispose in interface IBaseLabelProviderdispose in class BaseLabelProviderprotected final IWorkbenchAdapter getAdapter(Object o)
o - the object to look up.
null if the adapter is not defined or the
object is not adaptable.protected final IWorkbenchAdapter2 getAdapter2(Object o)
o - the object to look up.
null if the adapter is not defined or the
object is not adaptable.protected final IWorkbenchAdapter3 getAdapter3(Object o)
o - the object to look up.
null if the adapter is not
defined or the object is not adaptable.public final Image getImage(Object element)
LabelProviderLabelProvider implementation of this
ILabelProvider method returns null.
Subclasses may override.
getImage in interface DelegatingStyledCellLabelProvider.IStyledLabelProvidergetImage in interface ILabelProvidergetImage in class LabelProviderelement - the element for which to provide the label image
null
if there is no image for the given objectpublic StyledString getStyledText(Object element)
getStyledText in interface DelegatingStyledCellLabelProvider.IStyledLabelProviderelement - the element to evaluate the styled string for
protected StyledString.Styler getDecorationStyle(Object element)
StyledString.Styler to be used
for string decorations. By default the
decoration style. Clients can
override.
element - the element that has been decorated
public final String getText(Object element)
LabelProviderLabelProvider implementation of this
ILabelProvider method returns the element's
toString string. Subclasses may override.
getText in interface ILabelProvidergetText in class LabelProviderelement - the element for which to provide the label text
null
if there is no text label for the given objectpublic Color getForeground(Object element)
IColorProvider
getForeground in interface IColorProviderelement - the element
null
to use the default foreground colorpublic Color getBackground(Object element)
IColorProvider
getBackground in interface IColorProviderelement - the element
null
to use the default background colorpublic Font getFont(Object element)
IFontProvider
getFont in interface IFontProviderelement - the element
null
to use the default font
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.