Package org.apache.poi.xssf.usermodel
Class XSSFHyperlink
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.XSSFHyperlink
-
-
Constructor Summary
Constructors Constructor Description XSSFHyperlink(Hyperlink other)
Create a new XSSFHyperlink.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getAddress()
Hyperlink address.java.lang.String
getCellRef()
Get the reference of the cell this applies to, es A55CTHyperlink
getCTHyperlink()
int
getFirstColumn()
Return the column of the first cell that contains the hyperlinkint
getFirstRow()
Return the row of the first cell that contains the hyperlinkjava.lang.String
getLabel()
Return text label for this hyperlinkint
getLastColumn()
Return the column of the last cell that contains the hyperlinkint
getLastRow()
Return the row of the last cell that contains the hyperlinkjava.lang.String
getLocation()
Location within target.java.lang.String
getTooltip()
HyperlinkType
getType()
Return the type of this hyperlinkHyperlinkType
getTypeEnum()
Deprecated.usegetType
insteadboolean
needsRelationToo()
Do we need to a relation too, to represent this hyperlink?void
setAddress(java.lang.String address)
Hyperlink address.void
setCellReference(java.lang.String ref)
Assigns this hyperlink to the given cell referencevoid
setCellReference(CellReference ref)
void
setFirstColumn(int col)
Set the column of the first cell that contains the hyperlinkvoid
setFirstRow(int row)
Set the row of the first cell that contains the hyperlinkvoid
setLabel(java.lang.String label)
Sets text label for this hyperlinkvoid
setLastColumn(int col)
Set the column of the last cell that contains the hyperlink.void
setLastRow(int row)
Set the row of the last cell that contains the hyperlink.void
setLocation(java.lang.String location)
Location within target.void
setTooltip(java.lang.String text)
-
-
-
Constructor Detail
-
XSSFHyperlink
@Internal public XSSFHyperlink(Hyperlink other)
Create a new XSSFHyperlink. This method is for Internal use only. XSSFHyperlinks can be created byXSSFCreationHelper
. See the spreadsheet quick-guide for an example.- Parameters:
other
- the hyperlink to copy
-
-
Method Detail
-
getCTHyperlink
@Internal public CTHyperlink getCTHyperlink()
- Returns:
- the underlying CTHyperlink object
-
needsRelationToo
public boolean needsRelationToo()
Do we need to a relation too, to represent this hyperlink?
-
getType
public HyperlinkType getType()
Return the type of this hyperlink- Specified by:
getType
in interfaceHyperlink
- Returns:
- the type of this hyperlink
- See Also:
HyperlinkType.forInt(int)
-
getTypeEnum
@Deprecated @Removal(version="4.2") public HyperlinkType getTypeEnum()
Deprecated.usegetType
insteadReturn the type of this hyperlink- Specified by:
getTypeEnum
in interfaceHyperlink
- Returns:
- the type of this hyperlink
-
getCellRef
public java.lang.String getCellRef()
Get the reference of the cell this applies to, es A55
-
getAddress
public java.lang.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 interfaceHyperlink
- Returns:
- the address of this hyperlink
-
getLabel
public java.lang.String getLabel()
Return text label for this hyperlink
-
getLocation
public java.lang.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(java.lang.String label)
Sets text label for this hyperlink
-
setLocation
public void setLocation(java.lang.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(java.lang.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 interfaceHyperlink
- Parameters:
address
- - the address of this hyperlink
-
setCellReference
@Internal public void setCellReference(java.lang.String ref)
Assigns this hyperlink to the given cell reference
-
setCellReference
@Internal public void setCellReference(CellReference ref)
-
getFirstColumn
public int getFirstColumn()
Return the column of the first cell that contains the hyperlink- Specified by:
getFirstColumn
in interfaceHyperlink
- 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 interfaceHyperlink
- 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 interfaceHyperlink
- 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 interfaceHyperlink
- 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 interfaceHyperlink
- 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. For XSSF, a Hyperlink may only reference one cell- Specified by:
setLastColumn
in interfaceHyperlink
- 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 interfaceHyperlink
- 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. For XSSF, a Hyperlink may only reference one cell- Specified by:
setLastRow
in interfaceHyperlink
- Parameters:
row
- the 0-based row of the last cell that contains the hyperlink
-
getTooltip
public java.lang.String getTooltip()
- Returns:
- additional text to help the user understand more about the hyperlink
-
setTooltip
public void setTooltip(java.lang.String text)
- Parameters:
text
- additional text to help the user understand more about the hyperlink
-
-