Home » JCraft » jxl » write » biff » [javadoc | source]
jxl.write.biff
class: WritableSheetImpl [javadoc | source]
java.lang.Object
   jxl.write.biff.WritableSheetImpl

All Implemented Interfaces:
    WritableSheet

A writable sheet. This class contains implementation of all the writable sheet methods which may be invoke by the API
Constructor:
 public WritableSheetImpl(String n,
    File of,
    FormattingRecords fr,
    SharedStrings ss,
    WorkbookSettings ws,
    WritableWorkbookImpl ww) 
    Constructor
    Parameters:
    fr - the formatting records used by the workbook
    of - the output file to write the binary data
    f - the fonts used by the workbook
    n - the name of this sheet
    ss - the shared strings used by the workbook
    ws - the workbook settings
Method from jxl.write.biff.WritableSheetImpl Summary:
addCell,   addColumnPageBreak,   addDrawing,   addHyperlink,   addImage,   addRowPageBreak,   addValidationCell,   applySharedDataValidation,   checkMergedBorders,   copy,   copy,   findCell,   findCell,   findCell,   findLabelCell,   getCell,   getCell,   getCharts,   getColumn,   getColumnFormat,   getColumnInfo,   getColumnPageBreaks,   getColumnView,   getColumnWidth,   getColumns,   getComboBox,   getDataValidation,   getDrawing,   getFooter,   getHeader,   getHyperlinks,   getImage,   getMergedCells,   getName,   getNumberOfImages,   getRow,   getRowHeight,   getRowInfo,   getRowPageBreaks,   getRowRecord,   getRowView,   getRows,   getSettings,   getWorkbook,   getWorkbookSettings,   getWritableCell,   getWritableCell,   getWritableHyperlinks,   importSheet,   insertColumn,   insertRow,   isChartOnly,   isHidden,   isProtected,   mergeCells,   rationalize,   removeColumn,   removeDataValidation,   removeDrawing,   removeHyperlink,   removeHyperlink,   removeImage,   removeRow,   removeSharedDataValidation,   setColumnGroup,   setColumnView,   setColumnView,   setColumnView,   setComboBox,   setFooter,   setHeader,   setHidden,   setName,   setPageSetup,   setPageSetup,   setPageSetup,   setProtected,   setRowGroup,   setRowView,   setRowView,   setRowView,   setRowView,   setSelected,   unmergeCells,   unsetColumnGroup,   unsetRowGroup,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from jxl.write.biff.WritableSheetImpl Detail:
 public  void addCell(WritableCell cell) throws WriteException, RowsExceededException 
    Adds the cell to this sheet. If the cell has already been added to this sheet or another sheet, a WriteException is thrown. If the position to be occupied by this cell is already taken, the incumbent cell is replaced. The cell is then marked as referenced, and its formatting information registered with the list of formatting records updated if necessary The RowsExceededException may be caught if client code wishes to explicitly trap the case where too many rows have been written to the current sheet. If this behaviour is not desired, it is sufficient simply to handle the WriteException, since this is a base class of RowsExceededException
 public  void addColumnPageBreak(int col) 
    Forces a page break at the specified column
  void addDrawing(DrawingGroupObject o) 
    Adds a drawing to the list - typically used for comments
 public  void addHyperlink(WritableHyperlink h) throws WriteException, RowsExceededException 
    Adds the specified hyperlink
 public  void addImage(WritableImage image) 
    Adds an image to this sheet
 public  void addRowPageBreak(int row) 
    Forces a page break at the specified row
  void addValidationCell(CellValue cv) 
    Flags the added cell as having data validation
 public  void applySharedDataValidation(WritableCell c,
    int extraCols,
    int extraRows) throws WriteException 
    Extend the data validation contained in the specified cell across and downwards
  void checkMergedBorders() 
    Check all the merged cells for borders. Although in an OO sense the logic should belong in this class, in order to reduce the bloated nature of the source code for this object this logic has been delegated to the SheetWriter
  void copy(Sheet s) 
    Copies the specified sheet, row by row and cell by cell
  void copy(WritableSheet s) 
    Copies the specified sheet, row by row and cell by cell
 public Cell findCell(String contents) 
    Gets the cell whose contents match the string passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform
 public Cell findCell(String contents,
    int firstCol,
    int firstRow,
    int lastCol,
    int lastRow,
    boolean reverse) 
    Gets the cell whose contents match the string passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform
 public Cell findCell(Pattern pattern,
    int firstCol,
    int firstRow,
    int lastCol,
    int lastRow,
    boolean reverse) 
    Gets the cell whose contents match the regular expressionstring passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform
 public LabelCell findLabelCell(String contents) 
    Gets the cell whose contents match the string passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform. This method differs from the findCell methods in that only cells with labels are queried - all numerical cells are ignored. This should therefore improve performance.
 public Cell getCell(String loc) 
    Returns the cell for the specified location eg. "A4", using the CellReferenceHelper
 public Cell getCell(int column,
    int row) 
    Returns the cell specified at this row and at this column
 Chart[] getCharts() 
    Accessor for the charts. Used when copying
 public Cell[] getColumn(int col) 
    Gets all the cells on the specified column
 public CellFormat getColumnFormat(int col) 
Deprecated! Use - getColumnView instead

    Gets the column format for the specified column
 ColumnInfoRecord getColumnInfo(int c) 
    Gets the column info record for the specified column
 public int[] getColumnPageBreaks() 
    Accessor for the page breaks on this sheet
 public CellView getColumnView(int col) 
    Gets the column width for the specified column
 public int getColumnWidth(int col) 
Deprecated! Use - getColumnView instead

    Gets the column width for the specified column
 public int getColumns() 
    Returns the number of columns in this sheet
 ComboBox getComboBox() 
    Accessor for the combo box object used for list data validations on this sheet
 public DataValidation getDataValidation() 
    Gets the data validation. Retrieved by CellValue when copying sheets
 public Image getDrawing(int i) 
    Accessor for a particular image on this sheet
 final FooterRecord getFooter() 
    Gets the footer. Called when copying sheets
 final HeaderRecord getHeader() 
    Gets the header. Called when copying sheets
 public Hyperlink[] getHyperlinks() 
    Gets the hyperlinks on this sheet
 public WritableImage getImage(int i) 
    Accessor for a particular image on this sheet
 public Range[] getMergedCells() 
    Gets the cells which have been merged on this sheet
 public String getName() 
    Gets the name of this sheet
 public int getNumberOfImages() 
    Gets the number of images on this sheet
 public Cell[] getRow(int row) 
    Gets all the cells on the specified row
 public int getRowHeight(int row) 
Deprecated! Use - getRowView instead

    Gets the column width for the specified column
 RowRecord getRowInfo(int r) 
    Gets the row record for the specified row
 public int[] getRowPageBreaks() 
    Accessor for the page breaks on this sheet
 RowRecord getRowRecord(int row) throws RowsExceededException 
    Gets the row record at the specified row number, growing the array as needs dictate
 public CellView getRowView(int row) 
    Gets the row view for the specified row
 public int getRows() 
    Returns the number of rows in this sheet
 public SheetSettings getSettings() 
    Gets the settings for this sheet
 WritableWorkbookImpl getWorkbook() 
    Accessor for the workbook
 WorkbookSettings getWorkbookSettings() 
    Gets the workbook settings
 public WritableCell getWritableCell(String loc) 
    Returns the cell for the specified location eg. "A4". Note that this method is identical to calling getCell(CellReferenceHelper.getColumn(loc), CellReferenceHelper.getRow(loc)) and its implicit performance overhead for string parsing. As such,this method should therefore be used sparingly
 public WritableCell getWritableCell(int column,
    int row) 
    Returns the cell specified at this row and at this column
 public WritableHyperlink[] getWritableHyperlinks() 
    Gets the writable hyperlinks on this sheet
  void importSheet(Sheet s) 
    Imports a sheet from a different workbook
 public  void insertColumn(int col) 
    Inserts a blank column into this spreadsheet. If the column is out of range of the columns in the sheet, then no action is taken. If the max column on the sheet has been reached, then the last column entry gets dropped
 public  void insertRow(int row) 
    Inserts a blank row into this spreadsheet. If the row is out of range of the rows in the sheet, then no action is taken
 boolean isChartOnly() 
    Accessor for the chart only method
 public boolean isHidden() 
Deprecated! Use - the sheet settings bean instead

    Retrieves the hidden status of this sheet
 public boolean isProtected() 
Deprecated! Use - the SheetSettings bean instead

    Determines whether the sheet is protected
 public Range mergeCells(int col1,
    int row1,
    int col2,
    int row2) throws WriteException, RowsExceededException 
    Merges the specified cells. Any clashes or intersections between merged cells are resolved when the spreadsheet is written out
  void rationalize(IndexMapping xfMapping,
    IndexMapping fontMapping,
    IndexMapping formatMapping) 
    Rationalizes the sheets xf index mapping
 public  void removeColumn(int col) 
    Removes a column from this spreadsheet. If the column is out of range of the columns in the sheet, then no action is taken
  void removeDataValidation(CellValue cv) 
    Removes the data validation for the specified cell. Called from CellValue in response to a cell being replaced
  void removeDrawing(DrawingGroupObject o) 
    Removes a drawing to the list - typically used for comments
 public  void removeHyperlink(WritableHyperlink h) 
    Removes the specified hyperlink. Note that if you merely set the cell contents to be an Empty cell, then the cells containing the hyperlink will still be active. The contents of the cell which activate the hyperlink are removed. The hyperlink passed in must be a hyperlink retrieved using the getHyperlinks method
 public  void removeHyperlink(WritableHyperlink h,
    boolean preserveLabel) 
    Removes the specified hyperlink. Note that if you merely set the cell contents to be an Empty cell, then the cells containing the hyperlink will still be active. If the preserveLabel field is set, the cell contents of the hyperlink are preserved, although the hyperlink is deactivated. If this value is FALSE, the cell contents are removed The hyperlink passed in must be a hyperlink retrieved using the getHyperlinks method
 public  void removeImage(WritableImage wi) 
    Removes the specified image from this sheet. The image passed in must be the same instance as that retrieved from a getImage call
 public  void removeRow(int row) 
    Removes a row from this spreadsheet. If the row is out of range of the columns in the sheet, then no action is taken
 public  void removeSharedDataValidation(WritableCell cell) throws WriteException 
    Remove the shared data validation from multiple cells. The cell passed in is the top left cell. The data validation is removed from this cell and all cells which share the same validation.
 public  void setColumnGroup(int col1,
    int col2,
    boolean collapsed) throws WriteException, RowsExceededException 
    Sets a column grouping
 public  void setColumnView(int col,
    int width) 
    Sets the width (in characters) for a particular column in this sheet
 public  void setColumnView(int col,
    CellView view) 
    Sets the view for this column
 public  void setColumnView(int col,
    int width,
    CellFormat format) 
    Sets the width (in characters) and format options for a particular column in this sheet
  void setComboBox(ComboBox cb) 
    Sets the combo box object used for list validations on this sheet
 public  void setFooter(String l,
    String c,
    String r) 
Deprecated! Use - the sheet settings bean

    Sets the footer for this page
 public  void setHeader(String l,
    String c,
    String r) 
Deprecated! Use - the sheet settings bean

    Sets the header for this page
 public  void setHidden(boolean h) 
Deprecated! Use - the settings bean instead

    Sets the hidden status of this sheet
 public  void setName(String n) 
    Sets the name of this worksheet
 public  void setPageSetup(PageOrientation p) 
Deprecated! Use - the SheetSettings bean

    Sets the page setup details
 public  void setPageSetup(PageOrientation p,
    double hm,
    double fm) 
Deprecated! Use - the SheetSettings bean

    Sets the page setup details
 public  void setPageSetup(PageOrientation p,
    PaperSize ps,
    double hm,
    double fm) 
Deprecated! Use - the SheetSettings bean

    Sets the page setup details
 public  void setProtected(boolean prot) 
Deprecated! Use - the settings bean instead

    Indicates whether or not this sheet is protected
 public  void setRowGroup(int row1,
    int row2,
    boolean collapsed) throws WriteException, RowsExceededException 
    Sets a row grouping
 public  void setRowView(int row,
    int height) throws RowsExceededException 
Deprecated! use - the override which takes a CellView object

    Sets the height of the specified row, as well as its collapse status
 public  void setRowView(int row,
    boolean collapsed) throws RowsExceededException 
Deprecated! use - the override which takes a CellView object

    Sets the height of the specified row, as well as its collapse status
 public  void setRowView(int row,
    CellView view) throws RowsExceededException 
    Sets the view for this column
 public  void setRowView(int row,
    int height,
    boolean collapsed) throws RowsExceededException 
Deprecated! use - the override which takes a CellView object

    Sets the height of the specified row, as well as its collapse status
 public  void setSelected() 
Deprecated! Use - the settings bean

    Sets this sheet as selected
 public  void unmergeCells(Range r) 
    Unmerges the specified cells. The Range passed in should be one that has been previously returned as a result of the getMergedCells method
 public  void unsetColumnGroup(int col1,
    int col2) throws WriteException, RowsExceededException 
    Unsets a column grouping
 public  void unsetRowGroup(int row1,
    int row2) throws WriteException, RowsExceededException 
    Unsets a row grouping
 public  void write() throws IOException 
    Writes out this sheet. This functionality is delegated off to the SheetWriter class in order to reduce the bloated nature of this source file