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 AbstractBookAdv
public SBookSeries getBookSeries()
SBook
public String getBookName()
SBook
SBookSeries
public SSheet getSheet(int i)
SBook
i
- the sheet indexpublic int getNumOfSheet()
SBook
public SSheet getSheetByName(String name)
SBook
name
- the name of sheetpublic SSheet getSheetById(String id)
SBook
id
- the id of sheetprotected void checkOwnership(SSheet sheet)
protected void checkOwnership(SName name)
public void sendModelEvent(ModelEvent event)
sendModelEvent
in class AbstractBookAdv
public SSheet createSheet(String name)
SBook
name
- the name of sheetpublic SSheet createSheet(String name, SSheet src)
SBook
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 copyprotected Ref getRef()
public void setSheetName(SSheet sheet, String newname)
SBook
sheet
- the sheetnewname
- the new namepublic void deleteSheet(SSheet sheet)
SBook
sheet
- the sheetpublic void moveSheetTo(SSheet sheet, int index)
SBook
sheet
- the sheetindex
- the new positionpublic void dump(StringBuilder builder)
public SCellStyle getDefaultCellStyle()
SBook
public SCellStyle getDefaultCellStyle(int index)
SBook
public void setDefaultCellStyle(SCellStyle cellStyle)
SBook
public SCellStyle createCellStyle(boolean inStyleTable)
SBook
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 createCellStyle(SCellStyle src, boolean inStyleTable)
SBook
src
- 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)
SBook
matcher
- the style matcherpublic SExtraStyle searchExtraStyle(CellStyleMatcher matcher)
SBook
matcher
- the style matcherpublic SFont getDefaultFont()
public SFont createFont(boolean inFontTable)
public SFont searchFont(FontMatcher matcher)
public int getMaxRowSize()
SBook
public int getMaxColumnSize()
SBook
public void optimizeCellStyle()
SBook
public List<SCellStyle> getCellStyleTable()
public void addEventListener(ModelEventListener listener)
SBook
listener
- the listenerpublic void removeEventListener(ModelEventListener listener)
SBook
listener
- the listenerpublic Object getAttribute(String name)
SBook
name
- the attribute namepublic Object setAttribute(String name, Object value)
SBook
name
- name the attribute namevalue
- the attribute valuepublic Map<String,Object> getAttributes()
SBook
public SColor createColor(byte r, byte g, byte b)
public List<SSheet> getSheets()
SBook
public SName createName(String namename, String sheetName)
SBook
public void deleteName(SName name)
SBook
public int getNumOfName()
public SName getName(int idx)
public int getSheetIndex(SSheet sheet)
SBook
sheet
- the sheetpublic int getSheetIndex(String sheetName)
SBook
public void setShareScope(String scope)
public String getShareScope()
public EvaluationContributor getEvaluationContributor()
public void setEvaluationContributor(EvaluationContributor contributor)
public int getMaxRowIndex()
SBook
SBook.getMaxRowSize()
-1public int getMaxColumnIndex()
SBook
SBook.getMaxColumnIndex()
-1public String getId()
getId
in class AbstractBookAdv
public SPictureData addPictureData(SPicture.Format format, byte[] data)
SBook
SPictureData
into this bookformat
- picture formatdata
- picture raw datapublic SPictureData getPictureData(int index)
SBook
SPictureData
of the specified index from this book; null if not existpublic Collection<SPictureData> getPicturesDatas()
SBook
SPictureData
fo this book.public SNamedStyle getNamedStyle(String name)
SBook
public int addDefaultCellStyle(SCellStyle cellStyle)
SBook
public Collection<SCellStyle> getDefaultCellStyles()
SBook
public void addNamedCellstyle(SNamedStyle namedStyle)
SBook
public Collection<SNamedStyle> getNamedStyles()
SBook
public void clearDefaultCellStyles()
clearDefaultCellStyles
in class AbstractBookAdv
public void clearNamedStyles()
clearNamedStyles
in class AbstractBookAdv
public boolean isDirty()
SBook
#resetDirty()
public void setDirty(boolean dirty)
SBook
SBook.isDirty()
public SName createTableName(STable table)
createTableName
in class AbstractBookAdv
public void addTable(STable table)
addTable
in class AbstractBookAdv
public STable getTable(String name)
getTable
in class AbstractBookAdv
public STable removeTable(String name)
removeTable
in class AbstractBookAdv
public String setTableColumnName(STable table, String oldName, String newName)
setTableColumnName
in class AbstractBookAdv
public SCellStyle getOrCreateDefaultHyperlinkStyle()
SBook
public SCellStyle getOrCreateDefaultHyperlinkStyle(SCell cell)
SBook
public void initDefaultFont()
initDefaultFont
in class AbstractBookAdv
public int getCharWidth()
getCharWidth
in class AbstractBookAdv
public SExtraStyle getExtraStyleAt(int idx)
SBook
public void addExtraStyle(SExtraStyle extraStyle)
SBook
public List<SExtraStyle> getExtraStyles()
SBook
public void clearExtraStyles()
clearExtraStyles
in class AbstractBookAdv
public int indexOfExtraStyle(SExtraStyle style)
indexOfExtraStyle
in class AbstractBookAdv
public STableStyle getTableStyle(String name)
SBook
public void addTableStyle(STableStyle tableStyle)
SBook
public List<STableStyle> getTableStyles()
SBook
public void clearTableStyles()
SBook
public void setDefaultPivotStyleName(String name)
SBook
public String getDefaultPivotStyleName()
SBook
public void setDefaultTableStyleName(String name)
SBook
public String getDefaultTableStyleName()
SBook
public boolean isPostProcessing()
isPostProcessing
in class AbstractBookAdv
public void setPostProcessing(boolean b)
setPostProcessing
in class AbstractBookAdv
public boolean hasSubtotalExpression()
hasSubtotalExpression
in class AbstractBookAdv
public void resetSubtotalExpressionCache()
resetSubtotalExpressionCache
in class AbstractBookAdv
Copyright © 2020. All rights reserved.