Class FormulaTooltipErrorReporter

    • Constructor Detail

      • FormulaTooltipErrorReporter

        public FormulaTooltipErrorReporter​(NatTable natTable,
                                           IUniqueIndexLayer bodyDataLayer,
                                           String... tooltipRegions)
        Creates a FormulaTooltipErrorReporter for the given NatTable 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 - The NatTable to which the tooltip should be bound.
        bodyDataLayer - The DataLayer of the body region, needed to perform index transformations.
        tooltipRegions - The regions for which this FormulaTooltipErrorReporter 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 class NatTableContentTooltip
      • 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 this FormulaErrorReporter.
        Specified by:
        addFormulaError in interface FormulaErrorReporter
        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 interface FormulaErrorReporter
        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 interface FormulaErrorReporter
        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 or null if no error message is registered for that cell coordinates.
        Specified by:
        getFormulaError in interface FormulaErrorReporter
        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.