public interface SBook
Modifier and Type | Method and Description |
---|---|
int |
addDefaultCellStyle(SCellStyle cellStyle)
Add one more default cell style and return its index.
|
void |
addEventListener(ModelEventListener listener)
add event listener to this book
|
void |
addExtraStyle(SExtraStyle extraStyle)
Add one more extra cell style.
|
void |
addNamedCellstyle(SNamedStyle namedStyle)
Add one more named cell style.
|
SPictureData |
addPictureData(SPicture.Format format,
byte[] data)
Add
SPictureData into this book |
void |
addTableStyle(STableStyle tableStyle)
Add table style into this book.
|
void |
clearTableStyles()
Clear custom table styles of this book.
|
SCellStyle |
createCellStyle(boolean inStyleTable)
Create a cell style
|
SCellStyle |
createCellStyle(SCellStyle src,
boolean inStyleTable)
Create a cell style and copy the style from the src style.
|
SColor |
createColor(byte r,
byte g,
byte b) |
SColor |
createColor(String htmlColor) |
SFont |
createFont(boolean inFontTable) |
SFont |
createFont(SFont src,
boolean inFontTable) |
SName |
createName(String name) |
SName |
createName(String name,
String applyToSheetName)
Create a defined name on specified sheet
|
SSheet |
createSheet(String name)
Create a sheet
|
SSheet |
createSheet(String name,
SSheet src)
Create a sheet and copy the content from the specified src sheet; note
the owner book of the specified src sheet can be different from this
book.
|
void |
deleteName(SName name)
Delete a defined name
|
void |
deleteSheet(SSheet sheet)
Delete the sheet
|
Object |
getAttribute(String name)
Get the runtime custom attribute that stored in this book
|
Map<String,Object> |
getAttributes()
Get the unmodifiable runtime attributes map
|
String |
getBookName()
Get the book name, a book name is unique for book in
SBookSeries |
SBookSeries |
getBookSeries()
Get the book series, it contains a group of book that might refer to other by book name
|
SCellStyle |
getDefaultCellStyle()
Get the default style of this book
|
SCellStyle |
getDefaultCellStyle(int index)
Get the nth default style of this book
|
Collection<SCellStyle> |
getDefaultCellStyles()
Get all default cell styles.
|
SFont |
getDefaultFont() |
String |
getDefaultPivotStyleName()
Get default pivot style name.
|
String |
getDefaultTableStyleName()
Get default table style name
|
SExtraStyle |
getExtraStyleAt(int idx)
Get the extra style of this book
|
List<SExtraStyle> |
getExtraStyles()
Get all extra styles.
|
int |
getMaxColumnIndex()
Get the max column index of this book, it is
getMaxColumnIndex() -1 |
int |
getMaxColumnSize()
Get the max column size of this book
|
int |
getMaxRowIndex()
Get the max row index of this book, it is
getMaxRowSize() -1 |
int |
getMaxRowSize()
Get the max row size of this book
|
SName |
getName(int idx) |
SName |
getNameByName(String namename) |
SName |
getNameByName(String namename,
String sheetName) |
SNamedStyle |
getNamedStyle(String name)
Get the named style of this book
|
Collection<SNamedStyle> |
getNamedStyles()
Get all name styles.
|
List<SName> |
getNames() |
int |
getNumOfName() |
int |
getNumOfSheet()
Get the number of sheet
|
SCellStyle |
getOrCreateDefaultHyperlinkStyle()
Deprecated.
|
SCellStyle |
getOrCreateDefaultHyperlinkStyle(SCell cell)
Returns existing or create SCellStyle for hyperlink on the specified cell
|
SPictureData |
getPictureData(int index)
Get
SPictureData of the specified index from this book; null if not exist |
Collection<SPictureData> |
getPicturesDatas()
Returns all
SPictureData fo this book. |
String |
getShareScope() |
SSheet |
getSheet(int idx)
Get sheet at the index
|
SSheet |
getSheetById(String id)
Get the sheet by id
|
SSheet |
getSheetByName(String name)
Get the sheet by name
|
int |
getSheetIndex(SSheet sheet)
Get the index of sheet
|
int |
getSheetIndex(String sheetName)
Get the index of sheet
|
List<SSheet> |
getSheets()
Get all sheets
|
STableStyle |
getTableStyle(String name)
Get table style of the specified name.
|
List<STableStyle> |
getTableStyles()
Returns table styles of this book.
|
boolean |
isDirty()
Get if book is changed
|
void |
moveSheetTo(SSheet sheet,
int index)
Move the sheet to new position
|
void |
optimizeCellStyle()
Optimize CellStyle, usually called when export book or after many style operation
|
void |
removeEventListener(ModelEventListener listener)
remove event listener from this book
|
SCellStyle |
searchCellStyle(CellStyleMatcher matcher)
Search the style table and return the first matched style.
|
SExtraStyle |
searchExtraStyle(CellStyleMatcher matcher)
Search the style table and return the first matched style.
|
SFont |
searchFont(FontMatcher matcher) |
Object |
setAttribute(String name,
Object value)
Set the runtime custom attribute to stored in this book, the attribute is only use for developer to stored runtime data in the book,
values will not stored to excel when exporting.
|
void |
setDefaultCellStyle(SCellStyle cellStyle)
Set the default style of this book
|
void |
setDefaultPivotStyleName(String name)
Set default pivot style name.
|
void |
setDefaultTableStyleName(String name)
Set default table style name
|
void |
setDirty(boolean dirty)
Set dirty flag
|
void |
setNameName(SName name,
String newname) |
void |
setNameName(SName name,
String newname,
String applyToSheetName) |
void |
setShareScope(String scope) |
void |
setSheetName(SSheet sheet,
String newname)
Set the sheet to a new name
|
String getBookName()
SBookSeries
SBookSeries getBookSeries()
SSheet getSheet(int idx)
idx
- the sheet indexint getSheetIndex(SSheet sheet)
sheet
- the sheetint getSheetIndex(String sheetName)
sheet
- the sheetint getNumOfSheet()
SSheet getSheetByName(String name)
name
- the name of sheetSSheet getSheetById(String id)
id
- the id of sheetSSheet createSheet(String name)
name
- the name of sheetSSheet createSheet(String name, SSheet src)
name
- the name of the new created sheet; null would try to use
the sheet name of the specified src sheet; if the same sheet name
already used in this book then use default "SheetX" name where X is
the next sheet number of this book.src
- the source sheet to copyvoid setSheetName(SSheet sheet, String newname)
sheet
- the sheetnewname
- the new namevoid deleteSheet(SSheet sheet)
sheet
- the sheetvoid moveSheetTo(SSheet sheet, int index)
sheet
- the sheetindex
- the new positionSCellStyle getDefaultCellStyle()
void setDefaultCellStyle(SCellStyle cellStyle)
SCellStyle createCellStyle(boolean inStyleTable)
inStyleTable
- if true, the new created style will be stored inside this book,
then you can use searchCellStyle(CellStyleMatcher)
to search and reuse this style.SCellStyle createCellStyle(SCellStyle src, boolean inStyleTable)
src
- the source style to copy from.inStyleTable
- if true, the new created style will be stored inside this book,
then you can use searchCellStyle(CellStyleMatcher)
to search and reuse this style.SCellStyle searchCellStyle(CellStyleMatcher matcher)
matcher
- the style matcherSExtraStyle searchExtraStyle(CellStyleMatcher matcher)
matcher
- the style matcherSFont getDefaultFont()
SFont createFont(boolean inFontTable)
SFont searchFont(FontMatcher matcher)
SColor createColor(byte r, byte g, byte b)
int getMaxRowSize()
int getMaxColumnSize()
int getMaxRowIndex()
getMaxRowSize()
-1int getMaxColumnIndex()
getMaxColumnIndex()
-1void addEventListener(ModelEventListener listener)
listener
- the listenervoid removeEventListener(ModelEventListener listener)
listener
- the listenerObject getAttribute(String name)
name
- the attribute nameObject setAttribute(String name, Object value)
name
- name the attribute namevalue
- the attribute valueMap<String,Object> getAttributes()
SName createName(String name, String applyToSheetName)
void deleteName(SName name)
int getNumOfName()
SName getName(int idx)
void setShareScope(String scope)
String getShareScope()
void optimizeCellStyle()
SPictureData addPictureData(SPicture.Format format, byte[] data)
SPictureData
into this bookformat
- picture formatdata
- picture raw dataSPictureData getPictureData(int index)
SPictureData
of the specified index from this book; null if not existindex
- Collection<SPictureData> getPicturesDatas()
SPictureData
fo this book.SCellStyle getDefaultCellStyle(int index)
int addDefaultCellStyle(SCellStyle cellStyle)
cellStyle
- SNamedStyle getNamedStyle(String name)
name
- void addNamedCellstyle(SNamedStyle namedStyle)
namedStyle
- Collection<SCellStyle> getDefaultCellStyles()
Collection<SNamedStyle> getNamedStyles()
boolean isDirty()
#resetDirty()
void setDirty(boolean dirty)
dirty
- isDirty()
@Deprecated SCellStyle getOrCreateDefaultHyperlinkStyle()
SCellStyle getOrCreateDefaultHyperlinkStyle(SCell cell)
cell
- SExtraStyle getExtraStyleAt(int idx)
name
- void addExtraStyle(SExtraStyle extraStyle)
extraStyle
- List<SExtraStyle> getExtraStyles()
STableStyle getTableStyle(String name)
name
- void addTableStyle(STableStyle tableStyle)
tableStyle
- List<STableStyle> getTableStyles()
void clearTableStyles()
void setDefaultPivotStyleName(String name)
name
- String getDefaultPivotStyleName()
void setDefaultTableStyleName(String name)
name
- String getDefaultTableStyleName()
Copyright © 2020. All rights reserved.