|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A label provider maps an element of the viewer's model to
an optional image and optional text string used to display
the element in the viewer's control. Certain label providers
may allow multiple labels per element.
This is an "abstract interface", defining methods common
to all label providers, but does not actually define the methods
to get the label(s) for an element. This interface should never
be directly implemented.
Most viewers will take either an ILabelProvider
or
an ITableLabelProvider
.
A label provider must not be shared between viewers since a label provider generally manages SWT resources (images), which must be disposed when the viewer is disposed. To simplify life cycle management, the current label provider of a viewer is disposed when the viewer is disposed.
Label providers can be used outside the context of viewers wherever
images are needed. When label providers are used in this fashion
it is the responsibility of the user to ensure dispose
is called when the provider is no longer needed.
ILabelProvider
,
ITableLabelProvider
Method Summary | |
void |
addListener(ILabelProviderListener listener)
Adds a listener to this label provider. |
void |
dispose()
Disposes of this label provider. |
boolean |
isLabelProperty(Object element,
String property)
Returns whether the label would be affected by a change to the given property of the given element. |
void |
removeListener(ILabelProviderListener listener)
Removes a listener to this label provider. |
Method Detail |
public void addListener(ILabelProviderListener listener)
Label provider listeners are informed about state changes that affect the rendering of the viewer that uses this label provider.
listener
- a label provider listenerpublic void dispose()
public boolean isLabelProperty(Object element, String property)
element
- the elementproperty
- the property
true
if the label would be affected,
and false
if it would be unaffectedpublic void removeListener(ILabelProviderListener listener)
listener
- a label provider listener
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |