Package org.eclipse.jface.viewers
Class CellLabelProvider
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.viewers.BaseLabelProvider
org.eclipse.jface.viewers.CellLabelProvider
- All Implemented Interfaces:
IBaseLabelProvider
,IToolTipProvider
- Direct Known Subclasses:
ColumnLabelProvider
,ObservableMapCellLabelProvider
,OwnerDrawLabelProvider
The CellLabelProvider is an abstract implementation of a label provider for
structured viewers.
This class is intended to be subclassed
- Since:
- 3.3
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose
(ColumnViewer viewer, ViewerColumn column) Dispose of this label provider which was used with the given column viewer and column.getToolTipBackgroundColor
(Object object) Return the background color used for the tool tipint
getToolTipDisplayDelayTime
(Object object) The time in milliseconds until the tool tip is displayed.getToolTipFont
(Object object) Get theFont
used to display the tool tipgetToolTipForegroundColor
(Object object) The foreground color used to display the the text in the tool tipgetToolTipImage
(Object object) Get the image displayed in the tool tip for object.getToolTipShift
(Object object) Return the amount of pixels in x and y direction you want the tool tip to pop up from the mouse pointer.int
getToolTipStyle
(Object object) getToolTipText
(Object element) Get the text displayed in the tool tip for object.int
getToolTipTimeDisplayed
(Object object) The time in milliseconds the tool tip is shown for.protected void
initialize
(ColumnViewer viewer, ViewerColumn column) Initialize this label provider for use with the given column viewer for the given column.abstract void
update
(ViewerCell cell) Update the label for cell.boolean
useNativeToolTip
(Object object) Return whether or not to use the native tool tip.Methods inherited from class org.eclipse.jface.viewers.BaseLabelProvider
addListener, dispose, fireLabelProviderChanged, isLabelProperty, removeListener
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Constructor Details
-
CellLabelProvider
public CellLabelProvider()Create a new instance of the receiver.
-
-
Method Details
-
getToolTipImage
Get the image displayed in the tool tip for object.If
getToolTipText(Object)
andgetToolTipImage(Object)
both returnnull
the control is set back to standard behavior- Parameters:
object
- the element for which the tool tip is shown- Returns:
Image
ornull
if there is not image.
-
getToolTipText
Get the text displayed in the tool tip for object.If
getToolTipText(Object)
andgetToolTipImage(Object)
both returnnull
the control is set back to standard behavior- Specified by:
getToolTipText
in interfaceIToolTipProvider
- Parameters:
element
- the element for which the tool tip is shown- Returns:
- the
String
ornull
if there is not text to display
-
getToolTipBackgroundColor
Return the background color used for the tool tip- Parameters:
object
- theObject
for which the tool tip is shown- Returns:
- the
Color
used ornull
if you want to use the default colorSWT.COLOR_INFO_BACKGROUND
- See Also:
-
getToolTipForegroundColor
The foreground color used to display the the text in the tool tip- Parameters:
object
- theObject
for which the tool tip is shown- Returns:
- the
Color
used ornull
if you want to use the default colorSWT.COLOR_INFO_FOREGROUND
- See Also:
-
getToolTipFont
Get theFont
used to display the tool tip- Parameters:
object
- the element for which the tool tip is shown- Returns:
Font
ornull
if the default font is to be used.
-
getToolTipShift
Return the amount of pixels in x and y direction you want the tool tip to pop up from the mouse pointer. The default shift is 10px right and 0px below your mouse cursor. Be aware of the fact that you should at least position the tool tip 1px right to your mouse cursor else click events may not get propagated properly.- Parameters:
object
- the element for which the tool tip is shown- Returns:
Point
to shift of the tool tip ornull
if the default shift should be used.
-
useNativeToolTip
Return whether or not to use the native tool tip. If you switch to native tool tips only the value fromgetToolTipText(Object)
is used all other features from custom tool tips are not supported.To reset the control to native behavior you should return
true
from this method andnull
fromgetToolTipText(Object)
ornull
fromgetToolTipText(Object)
andgetToolTipImage(Object)
at the same time- Parameters:
object
- theObject
for which the tool tip is shown- Returns:
true
if native tool tips should be used
-
getToolTipTimeDisplayed
The time in milliseconds the tool tip is shown for.- Parameters:
object
- theObject
for which the tool tip is shown- Returns:
- time in milliseconds the tool tip is shown for
-
getToolTipDisplayDelayTime
The time in milliseconds until the tool tip is displayed.- Parameters:
object
- theObject
for which the tool tip is shown- Returns:
- time in milliseconds until the tool tip is displayed
-
getToolTipStyle
TheSWT
style used to create theCLabel
(see there for supported styles). By defaultSWT.SHADOW_NONE
is used.- Parameters:
object
- the element for which the tool tip is shown- Returns:
- the style used to create the label
- See Also:
-
update
Update the label for cell.- Parameters:
cell
-ViewerCell
-
initialize
Initialize this label provider for use with the given column viewer for the given column. Subclasses may extend but should call the super implementation (which at this time is empty but may be changed in the future).- Parameters:
viewer
- the viewercolumn
- the column, ornull
if a column is not available.- Since:
- 3.4
-
dispose
Dispose of this label provider which was used with the given column viewer and column. Subclasses may extend but should call the super implementation (which callsBaseLabelProvider.dispose()
).- Parameters:
viewer
- the viewercolumn
- the column, ornull
if a column is not available.- Since:
- 3.4
-