public class BookImpl extends AbstractBookAdv
| 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 |
addTable(STable table) |
void |
addTableStyle(STableStyle tableStyle)
Add table style into this book.
|
protected void |
checkOwnership(SName name) |
protected void |
checkOwnership(SSheet sheet) |
void |
clearDefaultCellStyles() |
void |
clearExtraStyles() |
void |
clearNamedStyles() |
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 namename) |
SName |
createName(String namename,
String sheetName)
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.
|
SName |
createTableName(STable table) |
void |
deleteName(SName name)
Delete a defined name
|
void |
deleteSheet(SSheet sheet)
Delete the sheet
|
void |
dump(StringBuilder builder) |
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
|
List<SCellStyle> |
getCellStyleTable() |
int |
getCharWidth()
Office Open XML Part 4: Markup Language Reference 3.3.1.12 col (Column
Width & Formatting) The character width 7 is based on Calibri 11 and
character width 8 is base on Calibri 12.
|
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
|
EvaluationContributor |
getEvaluationContributor() |
SExtraStyle |
getExtraStyleAt(int idx)
Get the extra style of this book
|
List<SExtraStyle> |
getExtraStyles()
Get all extra styles.
|
List<SFont> |
getFontTable() |
String |
getId() |
int |
getMaxColumnIndex()
Get the max column index of this book, it is
SBook.getMaxColumnIndex()-1 |
int |
getMaxColumnSize()
Get the max column size of this book
|
int |
getMaxRowIndex()
Get the max row index of this book, it is
SBook.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()
Returns existing or create SCellStyle for hyperlink.
|
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. |
protected Ref |
getRef() |
String |
getShareScope() |
SSheet |
getSheet(int i)
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
|
STable |
getTable(String name) |
STableStyle |
getTableStyle(String name)
Get table style of the specified name.
|
List<STableStyle> |
getTableStyles()
Returns table styles of this book.
|
boolean |
hasSubtotalExpression() |
int |
indexOfExtraStyle(SExtraStyle style) |
void |
initDefaultCellStyles() |
void |
initDefaultFont() |
boolean |
isDirty()
Get if book is changed
|
boolean |
isPostProcessing() |
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
|
STable |
removeTable(String name) |
void |
resetSubtotalExpressionCache() |
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) |
void |
sendModelEvent(ModelEvent event) |
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 |
setEvaluationContributor(EvaluationContributor contributor) |
void |
setNameName(SName name,
String newname) |
void |
setNameName(SName name,
String newname,
String sheetName) |
void |
setPostProcessing(boolean b) |
void |
setShareScope(String scope) |
void |
setSheetName(SSheet sheet,
String newname)
Set the sheet to a new name
|
String |
setTableColumnName(STable table,
String oldName,
String newName) |
public BookImpl(String bookName)
public void initDefaultCellStyles()
initDefaultCellStyles in class AbstractBookAdvpublic SBookSeries getBookSeries()
SBookpublic String getBookName()
SBookSBookSeriespublic SSheet getSheet(int i)
SBooki - the sheet indexpublic int getNumOfSheet()
SBookpublic SSheet getSheetByName(String name)
SBookname - the name of sheetpublic SSheet getSheetById(String id)
SBookid - the id of sheetprotected void checkOwnership(SSheet sheet)
protected void checkOwnership(SName name)
public void sendModelEvent(ModelEvent event)
sendModelEvent in class AbstractBookAdvpublic SSheet createSheet(String name)
SBookname - the name of sheetpublic SSheet createSheet(String name, SSheet src)
SBookname - 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 copyprotected Ref getRef()
public void setSheetName(SSheet sheet, String newname)
SBooksheet - the sheetnewname - the new namepublic void deleteSheet(SSheet sheet)
SBooksheet - the sheetpublic void moveSheetTo(SSheet sheet, int index)
SBooksheet - the sheetindex - the new positionpublic void dump(StringBuilder builder)
public SCellStyle getDefaultCellStyle()
SBookpublic SCellStyle getDefaultCellStyle(int index)
SBookpublic void setDefaultCellStyle(SCellStyle cellStyle)
SBookpublic SCellStyle createCellStyle(boolean inStyleTable)
SBookinStyleTable - if true, the new created style will be stored inside this book,
then you can use SBook.searchCellStyle(CellStyleMatcher) to search and reuse this style.public SCellStyle createCellStyle(SCellStyle src, boolean inStyleTable)
SBooksrc - the source style to copy from.inStyleTable - if true, the new created style will be stored inside this book,
then you can use SBook.searchCellStyle(CellStyleMatcher) to search and reuse this style.public SCellStyle searchCellStyle(CellStyleMatcher matcher)
SBookmatcher - the style matcherpublic SExtraStyle searchExtraStyle(CellStyleMatcher matcher)
SBookmatcher - the style matcherpublic SFont getDefaultFont()
public SFont createFont(boolean inFontTable)
public SFont searchFont(FontMatcher matcher)
public int getMaxRowSize()
SBookpublic int getMaxColumnSize()
SBookpublic void optimizeCellStyle()
SBookpublic List<SCellStyle> getCellStyleTable()
public void addEventListener(ModelEventListener listener)
SBooklistener - the listenerpublic void removeEventListener(ModelEventListener listener)
SBooklistener - the listenerpublic Object getAttribute(String name)
SBookname - the attribute namepublic Object setAttribute(String name, Object value)
SBookname - name the attribute namevalue - the attribute valuepublic Map<String,Object> getAttributes()
SBookpublic SColor createColor(byte r, byte g, byte b)
public List<SSheet> getSheets()
SBookpublic SName createName(String namename, String sheetName)
SBookpublic void deleteName(SName name)
SBookpublic int getNumOfName()
public SName getName(int idx)
public int getSheetIndex(SSheet sheet)
SBooksheet - the sheetpublic int getSheetIndex(String sheetName)
SBookpublic void setShareScope(String scope)
public String getShareScope()
public EvaluationContributor getEvaluationContributor()
public void setEvaluationContributor(EvaluationContributor contributor)
public int getMaxRowIndex()
SBookSBook.getMaxRowSize()-1public int getMaxColumnIndex()
SBookSBook.getMaxColumnIndex()-1public String getId()
getId in class AbstractBookAdvpublic SPictureData addPictureData(SPicture.Format format, byte[] data)
SBookSPictureData into this bookformat - picture formatdata - picture raw datapublic SPictureData getPictureData(int index)
SBookSPictureData of the specified index from this book; null if not existpublic Collection<SPictureData> getPicturesDatas()
SBookSPictureData fo this book.public SNamedStyle getNamedStyle(String name)
SBookpublic int addDefaultCellStyle(SCellStyle cellStyle)
SBookpublic Collection<SCellStyle> getDefaultCellStyles()
SBookpublic void addNamedCellstyle(SNamedStyle namedStyle)
SBookpublic Collection<SNamedStyle> getNamedStyles()
SBookpublic void clearDefaultCellStyles()
clearDefaultCellStyles in class AbstractBookAdvpublic void clearNamedStyles()
clearNamedStyles in class AbstractBookAdvpublic boolean isDirty()
SBook#resetDirty()public void setDirty(boolean dirty)
SBookSBook.isDirty()public SName createTableName(STable table)
createTableName in class AbstractBookAdvpublic void addTable(STable table)
addTable in class AbstractBookAdvpublic STable getTable(String name)
getTable in class AbstractBookAdvpublic STable removeTable(String name)
removeTable in class AbstractBookAdvpublic String setTableColumnName(STable table, String oldName, String newName)
setTableColumnName in class AbstractBookAdvpublic SCellStyle getOrCreateDefaultHyperlinkStyle()
SBookpublic SCellStyle getOrCreateDefaultHyperlinkStyle(SCell cell)
SBookpublic void initDefaultFont()
initDefaultFont in class AbstractBookAdvpublic int getCharWidth()
getCharWidth in class AbstractBookAdvpublic SExtraStyle getExtraStyleAt(int idx)
SBookpublic void addExtraStyle(SExtraStyle extraStyle)
SBookpublic List<SExtraStyle> getExtraStyles()
SBookpublic void clearExtraStyles()
clearExtraStyles in class AbstractBookAdvpublic int indexOfExtraStyle(SExtraStyle style)
indexOfExtraStyle in class AbstractBookAdvpublic STableStyle getTableStyle(String name)
SBookpublic void addTableStyle(STableStyle tableStyle)
SBookpublic List<STableStyle> getTableStyles()
SBookpublic void clearTableStyles()
SBookpublic void setDefaultPivotStyleName(String name)
SBookpublic String getDefaultPivotStyleName()
SBookpublic void setDefaultTableStyleName(String name)
SBookpublic String getDefaultTableStyleName()
SBookpublic boolean isPostProcessing()
isPostProcessing in class AbstractBookAdvpublic void setPostProcessing(boolean b)
setPostProcessing in class AbstractBookAdvpublic boolean hasSubtotalExpression()
hasSubtotalExpression in class AbstractBookAdvpublic void resetSubtotalExpressionCache()
resetSubtotalExpressionCache in class AbstractBookAdvCopyright © 2020. All rights reserved.