jxl.write

Class WritableHyperlink

Implemented Interfaces:
Hyperlink

public class WritableHyperlink
extends jxl.write.biff.HyperlinkRecord
implements Hyperlink

A writable hyperlink. Provides API to modify the contents of the hyperlink

Constructor Summary

WritableHyperlink(int col, int row, File file)
Constructs a file hyperlink in a single cell
WritableHyperlink(int col, int row, File file, String desc)
Constructs a file hyperlink in a single cell
WritableHyperlink(int col, int row, String desc, WritableSheet sheet, int destcol, int destrow)
Constructs a hyperlink to some cells within this workbook
WritableHyperlink(int col, int row, URL url)
Constructs a URL hyperlink in a single cell
WritableHyperlink(int col, int row, int lastcol, int lastrow, File file)
Constructs a File hyperlink to a range of cells
WritableHyperlink(int col, int row, int lastcol, int lastrow, File file, String desc)
Constructs a File hyperlink to a range of cells
WritableHyperlink(int col, int row, int lastcol, int lastrow, String desc, WritableSheet sheet, int destcol, int destrow, int lastdestcol, int lastdestrow)
Constructs a hyperlink to some cells within this workbook
WritableHyperlink(int col, int row, int lastcol, int lastrow, URL url)
Constructs a url hyperlink to a range of cells
WritableHyperlink(int col, int row, int lastcol, int lastrow, URL url, String desc)
Constructs a url hyperlink to a range of cells
WritableHyperlink(Hyperlink h, WritableSheet ws)
Constructor used internally by the worksheet when making a copy of worksheet

Method Summary

void
setDescription(String desc)
Sets the description to appear in the hyperlink cell
void
setFile(File file)
Sets the file activated by this hyperlink
void
setLocation(String desc, WritableSheet sheet, int destcol, int destrow, int lastdestcol, int lastdestrow)
Sets the location of the cells to be linked to within this workbook
void
setURL(URL url)
Sets the URL of this hyperlink

Methods inherited from class jxl.write.biff.HyperlinkRecord

getColumn, getData, getFile, getLastColumn, getLastRow, getRange, getRow, getURL, isFile, isLocation, isUNC, isURL, setFile, setURL, toString

Constructor Details

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         File file)
Constructs a file hyperlink in a single cell
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
file - the hyperlink

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         File file,
                         String desc)
Constructs a file hyperlink in a single cell
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
file - the hyperlink
desc - the hyperlink description

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         String desc,
                         WritableSheet sheet,
                         int destcol,
                         int destrow)
Constructs a hyperlink to some cells within this workbook
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
desc - the cell contents for this hyperlink
sheet - the sheet containing the cells to be linked to
destcol - the column number of the first destination linked cell
destrow - the row number of the first destination linked cell

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         URL url)
Constructs a URL hyperlink in a single cell
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
url - the hyperlink

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         int lastcol,
                         int lastrow,
                         File file)
Constructs a File hyperlink to a range of cells
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
file - the hyperlink

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         int lastcol,
                         int lastrow,
                         File file,
                         String desc)
Constructs a File hyperlink to a range of cells
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
file - the hyperlink
desc - the description

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         int lastcol,
                         int lastrow,
                         String desc,
                         WritableSheet sheet,
                         int destcol,
                         int destrow,
                         int lastdestcol,
                         int lastdestrow)
Constructs a hyperlink to some cells within this workbook
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
desc - the cell contents for this hyperlink
sheet - the sheet containing the cells to be linked to
destcol - the column number of the first destination linked cell
destrow - the row number of the first destination linked cell
lastdestcol - the column number of the last destination linked cell
lastdestrow - the row number of the last destination linked cell

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         int lastcol,
                         int lastrow,
                         URL url)
Constructs a url hyperlink to a range of cells
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
url - the hyperlink

WritableHyperlink

public WritableHyperlink(int col,
                         int row,
                         int lastcol,
                         int lastrow,
                         URL url,
                         String desc)
Constructs a url hyperlink to a range of cells
Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
url - the hyperlink
desc - the description text to place in the cell

WritableHyperlink

public WritableHyperlink(Hyperlink h,
                         WritableSheet ws)
Constructor used internally by the worksheet when making a copy of worksheet
Parameters:
h - the hyperlink being read in
ws - the writable sheet containing the hyperlink

Method Details

setDescription

public void setDescription(String desc)
Sets the description to appear in the hyperlink cell
Parameters:
desc - the description

setFile

public void setFile(File file)
Sets the file activated by this hyperlink
Overrides:
setFile in interface jxl.write.biff.HyperlinkRecord
Parameters:
file - the file

setLocation

public void setLocation(String desc,
                        WritableSheet sheet,
                        int destcol,
                        int destrow,
                        int lastdestcol,
                        int lastdestrow)
Sets the location of the cells to be linked to within this workbook
Parameters:
desc - the label describing the link
sheet - the sheet containing the cells to be linked to
destcol - the column number of the first destination linked cell
destrow - the row number of the first destination linked cell
lastdestcol - the column number of the last destination linked cell
lastdestrow - the row number of the last destination linked cell

setURL

public void setURL(URL url)
Sets the URL of this hyperlink
Overrides:
setURL in interface jxl.write.biff.HyperlinkRecord
Parameters:
url - the url