|
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.CellLabelProvider
org.eclipse.jface.viewers.OwnerDrawLabelProvider
org.eclipse.jface.viewers.StyledCellLabelProvider
org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider
public class DelegatingStyledCellLabelProvider
A DelegatingStyledCellLabelProvider is a
StyledCellLabelProvider that delegates requests for the styled string
and the image to a
DelegatingStyledCellLabelProvider.IStyledLabelProvider.
Existing label providers can be enhanced by implementing
DelegatingStyledCellLabelProvider.IStyledLabelProvider so they can be
used in viewers with styled labels.
The DelegatingStyledCellLabelProvider.IStyledLabelProvider can
optionally implement IColorProvider and IFontProvider to
provide foreground and background color and a default font.
| Nested Class Summary | |
|---|---|
static interface |
DelegatingStyledCellLabelProvider.IStyledLabelProvider
Interface marking a label provider that provides styled text labels and images. |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jface.viewers.StyledCellLabelProvider |
|---|
COLORS_ON_SELECTION, NO_FOCUS |
| Constructor Summary | |
|---|---|
DelegatingStyledCellLabelProvider(DelegatingStyledCellLabelProvider.IStyledLabelProvider labelProvider)
Creates a DelegatingStyledCellLabelProvider that delegates the
requests for the styled labels and the 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. |
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. |
DelegatingStyledCellLabelProvider.IStyledLabelProvider |
getStyledStringProvider()
Returns the styled string provider. |
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 |
update(ViewerCell cell)
Update the label for cell. |
| Methods inherited from class org.eclipse.jface.viewers.StyledCellLabelProvider |
|---|
erase, getColumn, getViewer, initialize, isOwnerDrawEnabled, measure, paint, prepareStyleRange, setOwnerDrawEnabled, styleDecoratedString |
| 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 DelegatingStyledCellLabelProvider(DelegatingStyledCellLabelProvider.IStyledLabelProvider labelProvider)
DelegatingStyledCellLabelProvider that delegates the
requests for the styled labels and the images to a
DelegatingStyledCellLabelProvider.IStyledLabelProvider.
labelProvider - the label provider that provides the styled labels and the
images| Method Detail |
|---|
public void update(ViewerCell cell)
CellLabelProvider
update in class StyledCellLabelProvidercell - ViewerCellpublic Color getForeground(Object element)
element - the element
null to
use the default foreground colorpublic Color getBackground(Object element)
element - the element
null to
use the default background colorpublic Font getFont(Object element)
element - the element
null to use the
default fontpublic Image getImage(Object element)
element - the element for which to provide the label image
null if
there is no image for the given objectprotected StyledString getStyledText(Object element)
element - the element for which to provide the styled label text
public DelegatingStyledCellLabelProvider.IStyledLabelProvider getStyledStringProvider()
public void addListener(ILabelProviderListener listener)
IBaseLabelProviderLabel provider listeners are informed about state changes that affect the rendering of the viewer that uses this label provider.
addListener in interface IBaseLabelProvideraddListener in class BaseLabelProviderlistener - a label provider listenerpublic void removeListener(ILabelProviderListener listener)
IBaseLabelProvider
removeListener in interface IBaseLabelProviderremoveListener in class BaseLabelProviderlistener - a label provider listener
public boolean isLabelProperty(Object element,
String property)
BaseLabelProviderBaseLabelProvider implementation of this
IBaseLabelProvider method returns true. Subclasses may
override.
isLabelProperty in interface IBaseLabelProviderisLabelProperty in class BaseLabelProviderelement - the elementproperty - the property
true if the label would be affected,
and false if it would be unaffectedpublic 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 StyledCellLabelProvider
|
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.