Class FormulaTooltipErrorReporter
- java.lang.Object
-
- org.eclipse.jface.window.ToolTip
-
- org.eclipse.jface.window.DefaultToolTip
-
- org.eclipse.nebula.widgets.nattable.tooltip.NatTableContentTooltip
-
- org.eclipse.nebula.widgets.nattable.formula.FormulaTooltipErrorReporter
-
- All Implemented Interfaces:
FormulaErrorReporter
public class FormulaTooltipErrorReporter extends NatTableContentTooltip implements FormulaErrorReporter
FormulaErrorReporter
implementation that shows formula errors in a tooltip. ExtendsNatTableContentTooltip
for showing the error.- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description protected IUniqueIndexLayer
bodyDataLayer
protected Map<IndexCoordinate,String>
formulaErrors
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.tooltip.NatTableContentTooltip
natTable, tooltipRegions
-
-
Constructor Summary
Constructors Constructor Description FormulaTooltipErrorReporter(NatTable natTable, IUniqueIndexLayer bodyDataLayer)
Creates aFormulaTooltipErrorReporter
for the givenNatTable
instance that shows formula error tooltips forGridRegion.BODY
.FormulaTooltipErrorReporter(NatTable natTable, IUniqueIndexLayer bodyDataLayer, String... tooltipRegions)
Creates aFormulaTooltipErrorReporter
for the givenNatTable
instance that shows formula error tooltips for the given grid regions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFormulaError(int column, int row, String message)
Registers the error message for the given cell coordinates to thisFormulaErrorReporter
.void
clearFormulaError(int column, int row)
Removes the error message for the given cell coordinates.String
getFormulaError(int column, int row)
Returns the error message that is registered for the given cell coordinates ornull
if no error message is registered for that cell coordinates.protected String
getText(org.eclipse.swt.widgets.Event event)
boolean
hasFormulaError(int column, int row)
Checks if an error message is registered for the given cell coordinates.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.tooltip.NatTableContentTooltip
getToolTipArea, isVisibleContentPainter, shouldCreateToolTip
-
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
-
-
-
-
Field Detail
-
formulaErrors
protected Map<IndexCoordinate,String> formulaErrors
-
bodyDataLayer
protected IUniqueIndexLayer bodyDataLayer
-
-
Constructor Detail
-
FormulaTooltipErrorReporter
public FormulaTooltipErrorReporter(NatTable natTable, IUniqueIndexLayer bodyDataLayer)
Creates aFormulaTooltipErrorReporter
for the givenNatTable
instance that shows formula error tooltips forGridRegion.BODY
.
-
FormulaTooltipErrorReporter
public FormulaTooltipErrorReporter(NatTable natTable, IUniqueIndexLayer bodyDataLayer, String... tooltipRegions)
Creates aFormulaTooltipErrorReporter
for the givenNatTable
instance that shows formula error tooltips for the given grid regions.This constructor is intended to be used for subclassing, if additionally to formula errors, tooltips should be shown in other grid regions too. Note that in this case
getText(Event)
needs to be overriden too.- Parameters:
natTable
- TheNatTable
to which the tooltip should be bound.bodyDataLayer
- TheDataLayer
of the body region, needed to perform index transformations.tooltipRegions
- The regions for which thisFormulaTooltipErrorReporter
should be activated.
-
-
Method Detail
-
getText
protected String getText(org.eclipse.swt.widgets.Event event)
Description copied from class:NatTableContentTooltip
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 classNatTableContentTooltip
-
addFormulaError
public void addFormulaError(int column, int row, String message)
Description copied from interface:FormulaErrorReporter
Registers the error message for the given cell coordinates to thisFormulaErrorReporter
.- Specified by:
addFormulaError
in interfaceFormulaErrorReporter
- Parameters:
column
- The column index of the cell where the error happened.row
- The row index of the cell where the error happened.message
- The error message.
-
clearFormulaError
public void clearFormulaError(int column, int row)
Description copied from interface:FormulaErrorReporter
Removes the error message for the given cell coordinates.- Specified by:
clearFormulaError
in interfaceFormulaErrorReporter
- Parameters:
column
- The column index of the cell for which an error message is registered.row
- The row index of the cell for which an error message is registered.
-
hasFormulaError
public boolean hasFormulaError(int column, int row)
Description copied from interface:FormulaErrorReporter
Checks if an error message is registered for the given cell coordinates.- Specified by:
hasFormulaError
in interfaceFormulaErrorReporter
- Parameters:
column
- The column index of the cell for which a check should be performed.row
- The row index of the cell for which a check should be performed.- Returns:
true
if an error message is registered for the given cell coordinates,false
if not.
-
getFormulaError
public String getFormulaError(int column, int row)
Description copied from interface:FormulaErrorReporter
Returns the error message that is registered for the given cell coordinates ornull
if no error message is registered for that cell coordinates.- Specified by:
getFormulaError
in interfaceFormulaErrorReporter
- Parameters:
column
- The column index of the cell for which the error message is requested.row
- The row index of the cell for which the error message is requested.- Returns:
- The error message that is registered for the given cell
coordinates or
null
if no error message is registered for that cell coordinates.
-
-