jxl.write
Class WritableCellFormat
java.lang.Object
jxl.biff.RecordData
jxl.biff.WritableRecordData
jxl.biff.XFRecord
jxl.write.biff.CellXFRecord
jxl.write.WritableCellFormat
- jxl.biff.ByteData, CellFormat
public class WritableCellFormat
extends jxl.write.biff.CellXFRecord
A user specified cell format, which may be reused across many cells.
The constructors takes parameters, such as font details and the numerical
date formats, which specify to Excel how cells with this format should be
displayed.
Once a CellFormat has been added to a Cell which has been added to
a sheet, then the CellFormat becomes immutable (to prevent unforeseen
effects on other cells which share the same format). Attempts to
call the various set... functions on a WritableCellFormat after this
time will result in a runtime exception.
WritableCellFormat() - A default constructor, which uses the default font and format.
|
WritableCellFormat(jxl.biff.DisplayFormat format) - A constructor which specifies a date/number format for Cells which
use this format object
|
WritableCellFormat(CellFormat format) - A public copy constructor which can be used for copy formats between
different sheets
|
WritableCellFormat(WritableFont font) - A CellFormat which specifies the font for cells with this format
|
WritableCellFormat(WritableFont font, jxl.biff.DisplayFormat format) - A constructor which specifies the font and date/number format for cells
which wish to use this format
|
equals , getAlignment , getBackgroundColour , getBorder , getBorderColour , getBorderLine , getData , getDateFormat , getFont , getFontIndex , getFormat , getFormatRecord , getIndentation , getNumberFormat , getOrientation , getPattern , getVerticalAlignment , getWrap , getXFIndex , hasBorders , hashCode , initialize , isDate , isInitialized , isLocked , isNumber , isRead , isShrinkToFit , setFont , uninitialize |
WritableCellFormat
public WritableCellFormat()
A default constructor, which uses the default font and format.
This constructor should be used in conjunction with the more
advanced two-phase methods setAlignment, setBorder etc.
WritableCellFormat
public WritableCellFormat(jxl.biff.DisplayFormat format)
A constructor which specifies a date/number format for Cells which
use this format object
WritableCellFormat
public WritableCellFormat(CellFormat format)
A public copy constructor which can be used for copy formats between
different sheets
format
- the cell format to copy
WritableCellFormat
public WritableCellFormat(WritableFont font)
A CellFormat which specifies the font for cells with this format
WritableCellFormat
public WritableCellFormat(WritableFont font,
jxl.biff.DisplayFormat format)
A constructor which specifies the font and date/number format for cells
which wish to use this format
font
- the fontformat
- the date/number format
setBackground
public void setBackground(Colour c)
throws WriteException
Sets the background colour for this cell format
setBackground
public void setBackground(Colour c,
Pattern p)
throws WriteException
Sets the background colour and pattern for this cell format
- setBackground in interface jxl.write.biff.CellXFRecord
c
- the colourp
- the pattern
setBorder
public void setBorder(Border b,
BorderLineStyle ls,
Colour c)
throws WriteException
Sets the specified border for this format
- setBorder in interface jxl.write.biff.CellXFRecord
b
- the borderls
- the border line stylec
- the colour of the specified border
setIndentation
public void setIndentation(int i)
throws WriteException
Sets the indentation of the cell text
- setIndentation in interface jxl.write.biff.CellXFRecord
setLocked
public void setLocked(boolean l)
throws WriteException
Sets whether or not this XF record locks the cell. For this to
have any effect, the sheet containing cells with this format must
also be locke3d
- setLocked in interface jxl.write.biff.CellXFRecord
setShrinkToFit
public void setShrinkToFit(boolean s)
throws WriteException
Sets the shrink to fit flag
- setShrinkToFit in interface jxl.write.biff.CellXFRecord
setWrap
public void setWrap(boolean w)
throws WriteException
Sets the wrap indicator for this format. If the wrap is set to TRUE, then
Excel will wrap data in cells with this format so that it fits within the
cell boundaries
- setWrap in interface jxl.write.biff.CellXFRecord