|
|||||||||
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 NameRecord[] |
names
The name records |
private File |
outputFile
The output file to write the workbook to |
private WorkbookSettings |
settings
The settigs 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 |
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 |
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 |
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 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 WritableWorkbook
public WritableSheet getSheet(int index)
getSheet
in class WritableWorkbook
index
- the zero based index of the reQuired sheetpublic WritableSheet getSheet(java.lang.String name)
getSheet
in class WritableWorkbook
name
- the sheet namepublic int getNumberOfSheets()
getNumberOfSheets
in class WritableWorkbook
public void close() throws java.io.IOException
close
in class WritableWorkbook
java.io.IOException
- public WritableSheet createSheet(java.lang.String name, int index)
createSheet
in class WritableWorkbook
name
- the name of the new sheetindex
- the index at which to add the sheetpublic void removeSheet(int index)
removeSheet
in class WritableWorkbook
index
- the index of the sheet to removepublic void write() throws java.io.IOException
write
in class WritableWorkbook
java.io.IOException
- private void copyWorkbook(Workbook w)
w
- the workbook to copypublic void copySheet(int s, java.lang.String name, int index)
copySheet
in class WritableWorkbook
s
- the index of the sheet to copyname
- the name of the new sheetindex
- the position of the new sheetpublic void copySheet(java.lang.String s, java.lang.String name, int index)
copySheet
in class WritableWorkbook
s
- 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 WritableWorkbook
prot
- protected flagprivate void rationalize()
public java.lang.String getExternalSheetName(int index)
getExternalSheetName
in interface ExternalSheet
index
- the external sheet indexpublic BOFRecord getWorkbookBof()
getWorkbookBof
in interface ExternalSheet
public int getExternalSheetIndex(java.lang.String sheetName)
getExternalSheetIndex
in interface ExternalSheet
sheetName
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |