|
Eclipse Platform Release 3.4 |
||||||||||
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.CellLabelProvider
org.eclipse.jface.viewers.OwnerDrawLabelProvider
org.eclipse.jface.viewers.StyledCellLabelProvider
org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider
org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider
A DecoratingStyledCellLabelProvider
is a
DelegatingStyledCellLabelProvider
that uses a nested
DelegatingStyledCellLabelProvider.IStyledLabelProvider
to compute
styled text label and image and takes a ILabelDecorator
to decorate
the label.
Use this label provider as a replacement for the
DecoratingLabelProvider
when decorating styled text labels.
The DecoratingStyledCellLabelProvider
will try to evaluate the text
decoration added by the ILabelDecorator
and will apply the style
returned by getDecorationStyle(Object)
The ILabelDecorator
can optionally implement IColorDecorator
and IFontDecorator
to provide foreground and background color and
font decoration.
Nested Class Summary |
Nested classes inherited from class org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider |
DelegatingStyledCellLabelProvider.IStyledLabelProvider |
Field Summary |
Fields inherited from class org.eclipse.jface.viewers.StyledCellLabelProvider |
COLORS_ON_SELECTION, NO_FOCUS |
Constructor Summary | |
DecoratingStyledCellLabelProvider(DelegatingStyledCellLabelProvider.IStyledLabelProvider labelProvider,
ILabelDecorator decorator,
IDecorationContext decorationContext)
Creates a DecoratingStyledCellLabelProvider that delegates the
requests for styled labels and for images to a
DelegatingStyledCellLabelProvider.IStyledLabelProvider . |
Method Summary | |
void |
addListener(ILabelProviderListener listener)
Adds a listener to this label provider. |
void |
dispose()
The BaseLabelProvider implementation of this
IBaseLabelProvider method clears its internal listener list.
|
Color |
getBackground(Object element)
Provides a background color for the given element. |
IDecorationContext |
getDecorationContext()
Returns the decoration context associated with this label provider. |
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)
Returns the image for the label of the given element. |
ILabelDecorator |
getLabelDecorator()
Returns the decorator or null if no decorator is installed |
protected StyledString |
getStyledText(Object element)
Returns the styled text for the label of the given element. |
boolean |
isLabelProperty(Object element,
String property)
The BaseLabelProvider implementation of this
IBaseLabelProvider method returns true . |
void |
removeListener(ILabelProviderListener listener)
Removes a listener to this label provider. |
void |
setDecorationContext(IDecorationContext decorationContext)
Set the decoration context that will be based to the decorator for this label provider if that decorator implements LabelDecorator . |
void |
setLabelDecorator(ILabelDecorator newDecorator)
Sets the label decorator. |
void |
update(ViewerCell cell)
Update the label for cell. |
Methods inherited from class org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider |
getStyledStringProvider |
Methods inherited from class org.eclipse.jface.viewers.StyledCellLabelProvider |
erase, getColumn, getViewer, initialize, isOwnerDrawEnabled, measure, paint, prepareStyleRange, setOwnerDrawEnabled |
Methods inherited from class org.eclipse.jface.viewers.OwnerDrawLabelProvider |
dispose, initialize, setOwnerDrawEnabled, setUpOwnerDraw |
Methods inherited from class org.eclipse.jface.viewers.CellLabelProvider |
getToolTipBackgroundColor, getToolTipDisplayDelayTime, getToolTipFont, getToolTipForegroundColor, getToolTipImage, getToolTipShift, getToolTipStyle, getToolTipText, getToolTipTimeDisplayed, useNativeToolTip |
Methods inherited from class org.eclipse.jface.viewers.BaseLabelProvider |
fireLabelProviderChanged |
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 |
Constructor Detail |
public DecoratingStyledCellLabelProvider(DelegatingStyledCellLabelProvider.IStyledLabelProvider labelProvider, ILabelDecorator decorator, IDecorationContext decorationContext)
DecoratingStyledCellLabelProvider
that delegates the
requests for styled labels and for images to a
DelegatingStyledCellLabelProvider.IStyledLabelProvider
.
labelProvider
- the styled label providerdecorator
- a label decorator or null
to not decorate the
labeldecorationContext
- a decoration context or null
if the no
decorator is configured or the default decorator should be
usedMethod Detail |
public IDecorationContext getDecorationContext()
LabelDecorator
.
public void setDecorationContext(IDecorationContext decorationContext)
LabelDecorator
.
decorationContext
- the decoration context.public void update(ViewerCell cell)
CellLabelProvider
update
in class DelegatingStyledCellLabelProvider
public Color getForeground(Object element)
DelegatingStyledCellLabelProvider
getForeground
in class DelegatingStyledCellLabelProvider
element
- the element
null
to
use the default foreground colorpublic Color getBackground(Object element)
DelegatingStyledCellLabelProvider
getBackground
in class DelegatingStyledCellLabelProvider
element
- the element
null
to
use the default background colorpublic Font getFont(Object element)
DelegatingStyledCellLabelProvider
getFont
in class DelegatingStyledCellLabelProvider
element
- the element
null
to use the
default fontpublic Image getImage(Object element)
DelegatingStyledCellLabelProvider
getImage
in class DelegatingStyledCellLabelProvider
element
- the element for which to provide the label image
null
if
there is no image for the given objectprotected StyledString getStyledText(Object element)
getStyledText
in class DelegatingStyledCellLabelProvider
element
- the element for which to provide the styled label text
protected StyledString.Styler getDecorationStyle(Object element)
StyledString.Styler
to be used for string
decorations. By default the
decoration style
. Clients
can override.
Note that it is the client's responsibility to react on color changes of
the decoration color by refreshing the view
element
- the element that has been decorated
public ILabelDecorator getLabelDecorator()
null
if no decorator is installed
null
if no decorator is installedpublic void setLabelDecorator(ILabelDecorator newDecorator)
newDecorator
- the label decorator, or null
if no decorations
are to be appliedpublic void addListener(ILabelProviderListener listener)
IBaseLabelProvider
Label provider listeners are informed about state changes that affect the rendering of the viewer that uses this label provider.
addListener
in interface IBaseLabelProvider
addListener
in class DelegatingStyledCellLabelProvider
public void removeListener(ILabelProviderListener listener)
IBaseLabelProvider
removeListener
in interface IBaseLabelProvider
removeListener
in class DelegatingStyledCellLabelProvider
public boolean isLabelProperty(Object element, String property)
BaseLabelProvider
BaseLabelProvider
implementation of this
IBaseLabelProvider
method returns true
. Subclasses may
override.
isLabelProperty
in interface IBaseLabelProvider
isLabelProperty
in class DelegatingStyledCellLabelProvider
public void dispose()
BaseLabelProvider
BaseLabelProvider
implementation of this
IBaseLabelProvider
method clears its internal listener list.
Subclasses may extend but should call the super implementation.
dispose
in interface IBaseLabelProvider
dispose
in class DelegatingStyledCellLabelProvider
|
Eclipse Platform Release 3.4 |
||||||||||
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, 2008. All rights reserved.