public class BookImpl extends AbstractBookAdv
Constructor and Description |
---|
BookImpl(java.lang.String bookName) |
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 |
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) |
protected void |
checkOwnership(SName name) |
protected void |
checkOwnership(SSheet sheet) |
void |
clearDefaultCellStyles() |
void |
clearNamedStyles() |
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(java.lang.String htmlColor) |
SFont |
createFont(boolean inFontTable) |
SFont |
createFont(SFont src,
boolean inFontTable) |
SName |
createName(java.lang.String namename) |
SName |
createName(java.lang.String namename,
java.lang.String sheetName)
Create a defined name on specified sheet
|
SSheet |
createSheet(java.lang.String name)
Create a sheet
|
SSheet |
createSheet(java.lang.String name,
SSheet src)
Create a sheet and copy the contain form the sheet sheet
|
SName |
createTableName(STable table) |
void |
deleteName(SName name)
Delete a defined name
|
void |
deleteSheet(SSheet sheet)
Delete the sheet
|
void |
dump(java.lang.StringBuilder builder) |
java.lang.Object |
getAttribute(java.lang.String name)
Get the runtime custom attribute that stored in this book
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Get the unmodifiable runtime attributes map
|
java.lang.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
|
java.util.List<SCellStyle> |
getCellStyleTable() |
SCellStyle |
getDefaultCellStyle()
Get the default style of this book
|
SCellStyle |
getDefaultCellStyle(int index)
Get the nth default style of this book
|
java.util.Collection<SCellStyle> |
getDefaultCellStyles()
Get all default cell styles.
|
SFont |
getDefaultFont() |
EvaluationContributor |
getEvaluationContributor() |
java.util.List<SFont> |
getFontTable() |
java.lang.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(java.lang.String namename) |
SName |
getNameByName(java.lang.String namename,
java.lang.String sheetName) |
SNamedStyle |
getNamedStyle(java.lang.String name)
Get the named style of this book
|
java.util.Collection<SNamedStyle> |
getNamedStyles()
Get all name styles.
|
java.util.List<SName> |
getNames() |
int |
getNumOfName() |
int |
getNumOfSheet()
Get the number of sheet
|
SCellStyle |
getOrCreateDefaultHyperlinkStyle()
Returns existing or create SCellStyle for hyperlink.
|
SPictureData |
getPictureData(int index)
Get
SPictureData of the specified index from this book; null if not exist |
java.util.Collection<SPictureData> |
getPicturesDatas()
Returns all
SPictureData fo this book. |
protected Ref |
getRef() |
java.lang.String |
getShareScope() |
SSheet |
getSheet(int i)
Get sheet at the index
|
SSheet |
getSheetById(java.lang.String id)
Get the sheet by id
|
SSheet |
getSheetByName(java.lang.String name)
Get the sheet by name
|
int |
getSheetIndex(SSheet sheet)
Get the index of sheet
|
int |
getSheetIndex(java.lang.String sheetName)
Get the index of sheet
|
java.util.List<SSheet> |
getSheets()
Get all sheets
|
STable |
getTable(java.lang.String name) |
void |
initDefaultCellStyles() |
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
|
STable |
removeTable(java.lang.String name) |
SCellStyle |
searchCellStyle(CellStyleMatcher matcher)
Search the style table and return the first matched style.
|
SFont |
searchFont(FontMatcher matcher) |
void |
sendModelEvent(ModelEvent event) |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.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 |
setDirty(boolean dirty)
Set dirty flag
|
void |
setEvaluationContributor(EvaluationContributor contributor) |
void |
setNameName(SName name,
java.lang.String newname) |
void |
setNameName(SName name,
java.lang.String newname,
java.lang.String sheetName) |
void |
setShareScope(java.lang.String scope) |
void |
setSheetName(SSheet sheet,
java.lang.String newname)
Set the sheet to a new name
|
java.lang.String |
setTableColumnName(STable table,
java.lang.String oldName,
java.lang.String newName) |
public void initDefaultCellStyles()
initDefaultCellStyles
in class AbstractBookAdv
public SBookSeries getBookSeries()
SBook
public java.lang.String getBookName()
SBook
SBookSeries
public SSheet getSheet(int i)
SBook
i
- the sheet indexpublic int getNumOfSheet()
SBook
public SSheet getSheetByName(java.lang.String name)
SBook
name
- the name of sheetpublic SSheet getSheetById(java.lang.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(java.lang.String name)
SBook
name
- the name of sheetpublic SSheet createSheet(java.lang.String name, SSheet src)
SBook
name
- the name of sheetsrc
- the source sheet to copyprotected Ref getRef()
public void setSheetName(SSheet sheet, java.lang.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(java.lang.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 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 java.util.List<SCellStyle> getCellStyleTable()
public java.util.List<SFont> getFontTable()
public void addEventListener(ModelEventListener listener)
SBook
listener
- the listenerpublic void removeEventListener(ModelEventListener listener)
SBook
listener
- the listenerpublic java.lang.Object getAttribute(java.lang.String name)
SBook
name
- the attribute namepublic java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
SBook
name
- name the attribute namevalue
- the attribute valuepublic java.util.Map<java.lang.String,java.lang.Object> getAttributes()
SBook
public SColor createColor(byte r, byte g, byte b)
public SColor createColor(java.lang.String htmlColor)
public java.util.List<SSheet> getSheets()
SBook
public SName createName(java.lang.String namename)
public SName createName(java.lang.String namename, java.lang.String sheetName)
SBook
public void setNameName(SName name, java.lang.String newname)
public void setNameName(SName name, java.lang.String newname, java.lang.String sheetName)
public void deleteName(SName name)
SBook
public int getNumOfName()
public SName getName(int idx)
public SName getNameByName(java.lang.String namename)
public SName getNameByName(java.lang.String namename, java.lang.String sheetName)
public java.util.List<SName> getNames()
public int getSheetIndex(SSheet sheet)
SBook
sheet
- the sheetpublic int getSheetIndex(java.lang.String sheetName)
SBook
public void setShareScope(java.lang.String scope)
public java.lang.String getShareScope()
public EvaluationContributor getEvaluationContributor()
public void setEvaluationContributor(EvaluationContributor contributor)
public int getMaxRowIndex()
SBook
SBook.getMaxRowSize()
-1public int getMaxColumnIndex()
SBook
SBook.getMaxColumnIndex()
-1public java.lang.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 java.util.Collection<SPictureData> getPicturesDatas()
SBook
SPictureData
fo this book.public SNamedStyle getNamedStyle(java.lang.String name)
SBook
public int addDefaultCellStyle(SCellStyle cellStyle)
SBook
public java.util.Collection<SCellStyle> getDefaultCellStyles()
SBook
public void addNamedCellstyle(SNamedStyle namedStyle)
SBook
public java.util.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(java.lang.String name)
getTable
in class AbstractBookAdv
public STable removeTable(java.lang.String name)
removeTable
in class AbstractBookAdv
public java.lang.String setTableColumnName(STable table, java.lang.String oldName, java.lang.String newName)
setTableColumnName
in class AbstractBookAdv
public SCellStyle getOrCreateDefaultHyperlinkStyle()
SBook
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.