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. Extends NatTableContentTooltip for showing the error.- Since:
- 1.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IUniqueIndexLayerprotected Map<IndexCoordinate,String> Fields inherited from class org.eclipse.nebula.widgets.nattable.tooltip.NatTableContentTooltip
natTable, tooltipRegionsFields inherited from class org.eclipse.jface.window.ToolTip
NO_RECREATE, RECREATE -
Constructor Summary
ConstructorsConstructorDescriptionFormulaTooltipErrorReporter(NatTable natTable, IUniqueIndexLayer bodyDataLayer) Creates aFormulaTooltipErrorReporterfor the givenNatTableinstance that shows formula error tooltips forGridRegion.BODY.FormulaTooltipErrorReporter(NatTable natTable, IUniqueIndexLayer bodyDataLayer, String... tooltipRegions) Creates aFormulaTooltipErrorReporterfor the givenNatTableinstance that shows formula error tooltips for the given grid regions. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFormulaError(int column, int row, String message) Registers the error message for the given cell coordinates to thisFormulaErrorReporter.voidclearFormulaError(int column, int row) Removes the error message for the given cell coordinates.getFormulaError(int column, int row) Returns the error message that is registered for the given cell coordinates ornullif no error message is registered for that cell coordinates.protected StringgetText(org.eclipse.swt.widgets.Event event) booleanhasFormulaError(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, shouldCreateToolTipMethods inherited from class org.eclipse.jface.window.DefaultToolTip
createToolTipContentArea, getBackgroundColor, getBackgroundImage, getFont, getForegroundColor, getImage, getStyle, setBackgroundColor, setBackgroundImage, setFont, setForegroundColor, setImage, setStyle, setTextMethods 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 Details
-
formulaErrors
-
bodyDataLayer
-
-
Constructor Details
-
FormulaTooltipErrorReporter
Creates aFormulaTooltipErrorReporterfor the givenNatTableinstance that shows formula error tooltips forGridRegion.BODY. -
FormulaTooltipErrorReporter
public FormulaTooltipErrorReporter(NatTable natTable, IUniqueIndexLayer bodyDataLayer, String... tooltipRegions) Creates aFormulaTooltipErrorReporterfor the givenNatTableinstance 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- TheNatTableto which the tooltip should be bound.bodyDataLayer- TheDataLayerof the body region, needed to perform index transformations.tooltipRegions- The regions for which thisFormulaTooltipErrorReportershould be activated.
-
-
Method Details
-
getText
Description copied from class:NatTableContentTooltipEvaluates the cell for which the tooltip should be rendered and checks the display value. If the display value is empty
nullwill be returned which will result in not showing a tooltip.- Overrides:
getTextin classNatTableContentTooltip
-
addFormulaError
Description copied from interface:FormulaErrorReporterRegisters the error message for the given cell coordinates to thisFormulaErrorReporter.- Specified by:
addFormulaErrorin 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:FormulaErrorReporterRemoves the error message for the given cell coordinates.- Specified by:
clearFormulaErrorin 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:FormulaErrorReporterChecks if an error message is registered for the given cell coordinates.- Specified by:
hasFormulaErrorin 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:
trueif an error message is registered for the given cell coordinates,falseif not.
-
getFormulaError
Description copied from interface:FormulaErrorReporterReturns the error message that is registered for the given cell coordinates ornullif no error message is registered for that cell coordinates.- Specified by:
getFormulaErrorin 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
nullif no error message is registered for that cell coordinates.
-