|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jxl.write.WritableWorkbook
|
+--jxl.write.biff.WritableWorkbookImpl
A writable workbook
| Field Summary | |
private boolean |
closeStream
Indicates whether or not the output stream should be closed. |
private ExternalSheetRecord |
externSheet
The list of external sheets, used by cell references in formulas |
private Fonts |
fonts
The list of fonts available within this workbook |
private FormattingRecords |
formatRecords
The list of formats available within this workbook |
private MsoDrawingGroupRecord |
msoDrawingGroup
The Mso Drawing Group |
private java.util.HashMap |
nameRecords
A lookup hash map of the name records |
private NameRecord[] |
names
The name records |
private File |
outputFile
The output file to write the workbook to |
private WorkbookSettings |
settings
The settings for the workbook |
private SharedStrings |
sharedStrings
The shared strings used by this workbook |
private java.util.ArrayList |
sheets
The list of sheets within this workbook |
private SupbookRecord[] |
supbooks
The supbook records |
private boolean |
wbProtected
The workbook protection flag |
| Fields inherited from class jxl.write.WritableWorkbook |
ARIAL_10_PT, HYPERLINK_FONT, HYPERLINK_STYLE, NORMAL_STYLE |
| Constructor Summary | |
WritableWorkbookImpl(java.io.OutputStream os,
boolean cs,
WorkbookSettings ws)
Constructor. |
|
WritableWorkbookImpl(java.io.OutputStream os,
Workbook w,
boolean cs,
WorkbookSettings ws)
A pseudo copy constructor. |
|
| Method Summary | |
void |
close()
Closes this workbook, and frees makes any memory allocated available for garbage collection |
void |
copySheet(int s,
java.lang.String name,
int index)
Copies the specified sheet and places it at the index specified by the parameter |
void |
copySheet(java.lang.String s,
java.lang.String name,
int index)
Copies the specified sheet and places it at the index specified by the parameter |
private void |
copyWorkbook(Workbook w)
Produces a writable copy of the workbook passed in by creating copies of each sheet in the specified workbook and adding them to its own record |
WritableSheet |
createSheet(java.lang.String name,
int index)
Creates a new sheet within the workbook, at the specified position. |
int |
getExternalSheetIndex(java.lang.String sheetName)
Gets the external sheet index for the sheet name |
java.lang.String |
getExternalSheetName(int index)
Gets the name of the external sheet specified by the index |
java.lang.String |
getName(int index)
Gets the name at the specified index |
int |
getNameIndex(java.lang.String name)
Gets the index of the name record for the name |
int |
getNumberOfSheets()
Returns the number of sheets in this workbook |
WritableSheet |
getSheet(int index)
Gets the specified sheet within this workbook |
WritableSheet |
getSheet(java.lang.String name)
Gets the sheet with the specified name from within this workbook |
WritableSheet[] |
getSheets()
Gets the sheets within this workbook. |
BOFRecord |
getWorkbookBof()
Parsing of formulas is only supported for a subset of the available biff version, so we need to test to see if this version is acceptable |
WritableSheet |
moveSheet(int fromIndex,
int toIndex)
Moves the specified sheet within this workbook to another index position. |
private void |
rationalize()
Rationalizes the cell formats, and then passes the resultant XF index mappings to each sheet in turn |
void |
removeSheet(int index)
Removes a sheet from this workbook, the other sheets indices being altered accordingly. |
void |
setColourRGB(Colour c,
int r,
int g,
int b)
Sets the RGB value for the specified colour for this workbook |
void |
setProtected(boolean prot)
Indicates whether or not this workbook is protected |
void |
write()
Writes out this sheet to the output file. |
| Methods inherited from class jxl.write.WritableWorkbook |
copy |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private FormattingRecords formatRecords
private File outputFile
private java.util.ArrayList sheets
private Fonts fonts
private ExternalSheetRecord externSheet
private MsoDrawingGroupRecord msoDrawingGroup
private SupbookRecord[] supbooks
private NameRecord[] names
private java.util.HashMap nameRecords
private SharedStrings sharedStrings
private boolean closeStream
private boolean wbProtected
private WorkbookSettings settings
| Constructor Detail |
public WritableWorkbookImpl(java.io.OutputStream os,
boolean cs,
WorkbookSettings ws)
throws java.io.IOException
os - the output streamcs - TRUE if the workbook should close the output stream, FALSEws - the configuration for this workbook
otherwisejava.io.IOException -
public WritableWorkbookImpl(java.io.OutputStream os,
Workbook w,
boolean cs,
WorkbookSettings ws)
throws java.io.IOException
w - the workbook to copyos - the output stream to write the data tocs - TRUE if the workbook should close the output stream, FALSEws - the configuration for this workbookjava.io.IOException - | Method Detail |
public WritableSheet[] getSheets()
getSheets in class WritableWorkbookpublic WritableSheet getSheet(int index)
getSheet in class WritableWorkbookindex - the zero based index of the reQuired sheetpublic WritableSheet getSheet(java.lang.String name)
getSheet in class WritableWorkbookname - the sheet namepublic int getNumberOfSheets()
getNumberOfSheets in class WritableWorkbook
public void close()
throws java.io.IOException
close in class WritableWorkbookjava.io.IOException -
public WritableSheet createSheet(java.lang.String name,
int index)
createSheet in class WritableWorkbookname - the name of the new sheetindex - the index at which to add the sheetpublic void removeSheet(int index)
removeSheet in class WritableWorkbookindex - the index of the sheet to remove
public WritableSheet moveSheet(int fromIndex,
int toIndex)
moveSheet in class WritableWorkbookfromIndex - the zero based index of the reQuired sheettoIndex - the zero based index of the reQuired sheet
public void write()
throws java.io.IOException
write in class WritableWorkbookjava.io.IOException - private void copyWorkbook(Workbook w)
w - the workbook to copy
public void copySheet(int s,
java.lang.String name,
int index)
copySheet in class WritableWorkbooks - the index of the sheet to copyname - the name of the new sheetindex - the position of the new sheet
public void copySheet(java.lang.String s,
java.lang.String name,
int index)
copySheet in class WritableWorkbooks - the name of the sheet to copyname - the name of the new sheetindex - the position of the new sheetpublic void setProtected(boolean prot)
setProtected in class WritableWorkbookprot - protected flagprivate void rationalize()
public java.lang.String getExternalSheetName(int index)
getExternalSheetName in interface ExternalSheetindex - the external sheet indexpublic BOFRecord getWorkbookBof()
getWorkbookBof in interface ExternalSheetpublic int getExternalSheetIndex(java.lang.String sheetName)
getExternalSheetIndex in interface ExternalSheetsheetName -
public void setColourRGB(Colour c,
int r,
int g,
int b)
setColourRGB in class WritableWorkbookc - the colour whose RGB value is to be overwrittenr - the red portion to set (0-255)g - the green portion to set (0-255)b - the blue portion to set (0-255)public java.lang.String getName(int index)
getName in interface NameTableindex - the index into the name tablepublic int getNameIndex(java.lang.String name)
getNameIndex in interface NameTablename -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||