Class XSSFHyperlink

    • Constructor Detail

      • XSSFHyperlink

        protected XSSFHyperlink​(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTHyperlink ctHyperlink,
                                PackageRelationship hyperlinkRel)
        Create a XSSFHyperlink and initialize it from the supplied CTHyperlink bean and package relationship
        Parameters:
        ctHyperlink - the xml bean containing xml properties
        hyperlinkRel - the relationship in the underlying OPC package which stores the actual link's address
    • Method Detail

      • getCTHyperlink

        @Internal
        public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTHyperlink getCTHyperlink()
        Returns:
        the underlying CTHyperlink object
      • needsRelationToo

        public boolean needsRelationToo()
        Do we need to a relation too, to represent this hyperlink?
      • generateRelationIfNeeded

        protected void generateRelationIfNeeded​(PackagePart sheetPart)
        Generates the relation if required
      • getType

        public HyperlinkType getType()
        Return the type of this hyperlink
        Specified by:
        getType in interface Hyperlink
        Returns:
        the type of this hyperlink
      • getCellRef

        public String getCellRef()
        Get the address of the cell this hyperlink applies to, e.g. A55
      • getAddress

        public String getAddress()
        Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file. The is the hyperlink target.
        Specified by:
        getAddress in interface Hyperlink
        Returns:
        the address of this hyperlink
      • getLabel

        public String getLabel()
        Return text label for this hyperlink
        Specified by:
        getLabel in interface Hyperlink
        Returns:
        text to display
      • getLocation

        public String getLocation()
        Location within target. If target is a workbook (or this workbook) this shall refer to a sheet and cell or a defined name. Can also be an HTML anchor if target is HTML file.
        Returns:
        location
      • setLabel

        public void setLabel​(String label)
        Sets text label for this hyperlink
        Specified by:
        setLabel in interface Hyperlink
        Parameters:
        label - text label for this hyperlink
      • setLocation

        public void setLocation​(String location)
        Location within target. If target is a workbook (or this workbook) this shall refer to a sheet and cell or a defined name. Can also be an HTML anchor if target is HTML file.
        Parameters:
        location - - string representing a location of this hyperlink
      • setAddress

        public void setAddress​(String address)
        Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file This is the hyperlink target.
        Specified by:
        setAddress in interface Hyperlink
        Parameters:
        address - - the address of this hyperlink
      • setCellReference

        @Internal
        public void setCellReference​(String ref)
        Assigns this hyperlink to the given cell reference
      • getFirstColumn

        public int getFirstColumn()
        Return the column of the first cell that contains the hyperlink
        Specified by:
        getFirstColumn in interface Hyperlink
        Returns:
        the 0-based column of the first cell that contains the hyperlink
      • getLastColumn

        public int getLastColumn()
        Return the column of the last cell that contains the hyperlink
        Specified by:
        getLastColumn in interface Hyperlink
        Returns:
        the 0-based column of the last cell that contains the hyperlink
      • getFirstRow

        public int getFirstRow()
        Return the row of the first cell that contains the hyperlink
        Specified by:
        getFirstRow in interface Hyperlink
        Returns:
        the 0-based row of the cell that contains the hyperlink
      • getLastRow

        public int getLastRow()
        Return the row of the last cell that contains the hyperlink
        Specified by:
        getLastRow in interface Hyperlink
        Returns:
        the 0-based row of the last cell that contains the hyperlink
      • setFirstColumn

        public void setFirstColumn​(int col)
        Set the column of the first cell that contains the hyperlink
        Specified by:
        setFirstColumn in interface Hyperlink
        Parameters:
        col - the 0-based column of the first cell that contains the hyperlink
      • setLastColumn

        public void setLastColumn​(int col)
        Set the column of the last cell that contains the hyperlink.
        Specified by:
        setLastColumn in interface Hyperlink
        Parameters:
        col - the 0-based column of the last cell that contains the hyperlink
      • setFirstRow

        public void setFirstRow​(int row)
        Set the row of the first cell that contains the hyperlink
        Specified by:
        setFirstRow in interface Hyperlink
        Parameters:
        row - the 0-based row of the first cell that contains the hyperlink
      • setLastRow

        public void setLastRow​(int row)
        Set the row of the last cell that contains the hyperlink.
        Specified by:
        setLastRow in interface Hyperlink
        Parameters:
        row - the 0-based row of the last cell that contains the hyperlink
      • getTooltip

        public String getTooltip()
        Returns:
        additional text to help the user understand more about the hyperlink
      • setTooltip

        public void setTooltip​(String text)
        Parameters:
        text - additional text to help the user understand more about the hyperlink
      • copy

        public Duplicatable copy()
        Specified by:
        copy in interface Duplicatable
        Returns:
        a new XSSFHyperlink based on this
        Since:
        POI 5.1.0