Class NatTableContentTooltip
- java.lang.Object
-
- org.eclipse.jface.window.ToolTip
-
- org.eclipse.jface.window.DefaultToolTip
-
- org.eclipse.nebula.widgets.nattable.tooltip.NatTableContentTooltip
-
- Direct Known Subclasses:
FormulaTooltipErrorReporter
public class NatTableContentTooltip extends org.eclipse.jface.window.DefaultToolTip
-
-
Constructor Summary
Constructors Constructor Description NatTableContentTooltip(NatTable natTable, int style, boolean manualActivation, String... tooltipRegions)
Creates a newToolTip
object, attached to the givenNatTable
instance.NatTableContentTooltip(NatTable natTable, String... tooltipRegions)
Creates a newToolTip
object, attaches it to the givenNatTable
instance and configures and activates it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getText(org.eclipse.swt.widgets.Event event)
protected Object
getToolTipArea(org.eclipse.swt.widgets.Event event)
protected boolean
isVisibleContentPainter(ICellPainter painter)
Checks if the givenICellPainter
is showing the content directly or if it is anonymized by using thePasswordTextPainter
protected boolean
shouldCreateToolTip(org.eclipse.swt.widgets.Event event)
-
Methods inherited from class org.eclipse.jface.window.DefaultToolTip
createToolTipContentArea, getBackgroundColor, getBackgroundImage, getFont, getForegroundColor, getImage, getStyle, setBackgroundColor, setBackgroundImage, setFont, setForegroundColor, setImage, setStyle, setText
-
Methods inherited from class org.eclipse.jface.window.ToolTip
activate, afterHideToolTip, deactivate, getData, getLocation, hide, isHideOnMouseDown, isRespectDisplayBounds, isRespectMonitorBounds, setData, setHideDelay, setHideOnMouseDown, setPopupDelay, setRespectDisplayBounds, setRespectMonitorBounds, setShift, show
-
-
-
-
Constructor Detail
-
NatTableContentTooltip
public NatTableContentTooltip(NatTable natTable, String... tooltipRegions)
Creates a newToolTip
object, attaches it to the givenNatTable
instance and configures and activates it. UsesToolTip.NO_RECREATE
as style option and manualActivation == false.
-
NatTableContentTooltip
public NatTableContentTooltip(NatTable natTable, int style, boolean manualActivation, String... tooltipRegions)
Creates a newToolTip
object, attached to the givenNatTable
instance.- Parameters:
natTable
- TheNatTable
instance for which thisToolTip
is used.style
- The style passed to control tooltip behaviour.manualActivation
-true
if the activation is done manually usingToolTip.show(Point)
.tooltipRegions
- The regions of theNatTable
for which thisToolTip
is active. If none are given, the tooltip will be active for all regions.- Since:
- 1.6
- See Also:
ToolTip.RECREATE
,ToolTip.NO_RECREATE
-
-
Method Detail
-
getToolTipArea
protected Object getToolTipArea(org.eclipse.swt.widgets.Event event)
Implementation here means the tooltip is not redrawn unless mouse hover moves outside of the current cell (the combination of ToolTip.NO_RECREATE style and override of this method).
- Overrides:
getToolTipArea
in classorg.eclipse.jface.window.ToolTip
-
getText
protected String getText(org.eclipse.swt.widgets.Event event)
Evaluates the cell for which the tooltip should be rendered and checks the display value. If the display value is empty
null
will be returned which will result in not showing a tooltip.- Overrides:
getText
in classorg.eclipse.jface.window.DefaultToolTip
-
isVisibleContentPainter
protected boolean isVisibleContentPainter(ICellPainter painter)
Checks if the givenICellPainter
is showing the content directly or if it is anonymized by using thePasswordTextPainter
- Parameters:
painter
- TheICellPainter
to check.- Returns:
true
if the painter is not aPasswordTextPainter
-
shouldCreateToolTip
protected boolean shouldCreateToolTip(org.eclipse.swt.widgets.Event event)
Will only display a tooltip if the value of the cell for which the tooltip should be rendered is not empty.
If there are regions configured for which the tooltip should be visible, it is also checked if the the region for which the tooltip should be rendered is in one of the configured tooltip regions.
- Overrides:
shouldCreateToolTip
in classorg.eclipse.jface.window.ToolTip
-
-