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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose(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 tipintgetToolTipDisplayDelayTime(Object object) The time in milliseconds until the tool tip is displayed.getToolTipFont(Object object) Get theFontused 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.intgetToolTipStyle(Object object) getToolTipText(Object element) Get the text displayed in the tool tip for object.intgetToolTipTimeDisplayed(Object object) The time in milliseconds the tool tip is shown for.protected voidinitialize(ColumnViewer viewer, ViewerColumn column) Initialize this label provider for use with the given column viewer for the given column.abstract voidupdate(ViewerCell cell) Update the label for cell.booleanuseNativeToolTip(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, removeListenerMethods 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 returnnullthe control is set back to standard behavior- Parameters:
object- the element for which the tool tip is shown- Returns:
Imageornullif there is not image.
-
getToolTipText
Get the text displayed in the tool tip for object.If
getToolTipText(Object)andgetToolTipImage(Object)both returnnullthe control is set back to standard behavior- Specified by:
getToolTipTextin interfaceIToolTipProvider- Parameters:
element- the element for which the tool tip is shown- Returns:
- the
Stringornullif there is not text to display
-
getToolTipBackgroundColor
Return the background color used for the tool tip- Parameters:
object- theObjectfor which the tool tip is shown- Returns:
- the
Colorused ornullif 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- theObjectfor which the tool tip is shown- Returns:
- the
Colorused ornullif you want to use the default colorSWT.COLOR_INFO_FOREGROUND - See Also:
-
getToolTipFont
Get theFontused to display the tool tip- Parameters:
object- the element for which the tool tip is shown- Returns:
Fontornullif 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:
Pointto shift of the tool tip ornullif 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
truefrom this method andnullfromgetToolTipText(Object)ornullfromgetToolTipText(Object)andgetToolTipImage(Object)at the same time- Parameters:
object- theObjectfor which the tool tip is shown- Returns:
trueif native tool tips should be used
-
getToolTipTimeDisplayed
The time in milliseconds the tool tip is shown for.- Parameters:
object- theObjectfor 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- theObjectfor which the tool tip is shown- Returns:
- time in milliseconds until the tool tip is displayed
-
getToolTipStyle
TheSWTstyle used to create theCLabel(see there for supported styles). By defaultSWT.SHADOW_NONEis 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, ornullif 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, ornullif a column is not available.- Since:
- 3.4
-