You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.component.spreadsheet.

Class DefaultHyperlinkCellClickHandler

  • java.lang.Object
    • com.vaadin.flow.component.spreadsheet.DefaultHyperlinkCellClickHandler
    • Method Detail

      • getSpreadsheet

        protected Spreadsheet getSpreadsheet()

        expose for subclasses

        Returns:

        Spreadsheet for this handler

      • onHyperLinkCellClick

        public void onHyperLinkCellClick​(org.apache.poi.ss.usermodel.Cell cell,
                                         org.apache.poi.ss.usermodel.Hyperlink hyperlink)

        Called when a hyperlink cell has been clicked.

        Specified by:

        onHyperLinkCellClick in interface Spreadsheet.HyperlinkCellClickHandler

        Parameters:

        cell -

        hyperlink - may be null, only for Excel link relations, not formula

      • getHyperlinkFunctionTarget

        public String getHyperlinkFunctionTarget​(org.apache.poi.ss.usermodel.Cell cell)

        Should only be called for cells isHyperlinkFormulaCell(Cell) returns true. Returns the target for tooltip use by default.

        The address is inside the first argument: HYPERLINK("address","friendly name") or HYPERLINK("#!viewName[/arguments]","friendly name") or HYPERLINK(D5,"friendly name") or HYPERLINK([arbitrary formula],"friendly name")

        Specified by:

        getHyperlinkFunctionTarget in interface Spreadsheet.HyperlinkCellClickHandler

        Parameters:

        cell - Target cell containing a hyperlink function

        Returns:

        the address that the hyperlink function points to

      • getFirstArgumentFromFormula

        protected String getFirstArgumentFromFormula​(org.apache.poi.ss.usermodel.Cell cell)

        we parse the formula with a formula/POI trick so we don't have to use tricky regular expressions that hit terminal runaway evaluation cases see: https://www.regular-expressions.info/catastrophic.html Instead, translate

         HYPERLINK(arg1[, arg2])
         to
         IF(true, arg1[, arg2])
         

      • isHyperlinkFormulaCell

        public static final boolean isHyperlinkFormulaCell​(org.apache.poi.ss.usermodel.Cell cell)

        Returns true if the cell contains a hyperlink function.

        Parameters:

        cell - Cell to investigate

        Returns:

        True if hyperlink is found