|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.viewers.LabelProvider | +--org.eclipse.ui.model.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()
Disposes of all allocated images. |
protected IWorkbenchAdapter |
getAdapter(Object o)
Returns the implementation of IWorkbenchAdapter for the given object. |
static ILabelProvider |
getDecoratingWorkbenchLabelProvider()
Returns a workbench label provider that is hooked up to the decorator mechanism. |
Image |
getImage(Object element)
The LabelProvider implementation of this
ILabelProvider method returns null . |
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.LabelProvider |
addListener, fireLabelProviderChanged, isLabelProperty, removeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WorkbenchLabelProvider()
Method Detail |
public static ILabelProvider getDecoratingWorkbenchLabelProvider()
DecoratingLabelProvider
which wraps a
new WorkbenchLabelProvider
protected ImageDescriptor decorateImage(ImageDescriptor input, Object element)
CompositeImageDescriptor
protected String decorateText(String input, Object element)
public final void dispose()
dispose
in class LabelProvider
protected final IWorkbenchAdapter getAdapter(Object o)
null
if the adapter is not defined or the
object is not adaptable.public final Image getImage(Object element)
LabelProvider
LabelProvider
implementation of this
ILabelProvider
method returns null
. Subclasses may
override.getImage
in class LabelProvider
org.eclipse.jface.viewers.ILabelProvider
element
- the element for which to provide the label imagenull
if there is no image for the given objectpublic final String getText(Object element)
LabelProvider
LabelProvider
implementation of this
ILabelProvider
method returns the element's toString
string. Subclasses may override.getText
in class LabelProvider
org.eclipse.jface.viewers.ILabelProvider
element
- the element for which to provide the label textnull
if there is no text label for the given object
|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |