org.zkoss.zss.model.impl
Class HSSFBookImpl

java.lang.Object
  extended by org.zkoss.poi.POIDocument
      extended by org.zkoss.poi.hssf.usermodel.HSSFWorkbook
          extended by org.zkoss.zss.model.impl.HSSFBookImpl
All Implemented Interfaces:
org.zkoss.poi.ss.usermodel.Workbook, Book, BookCtrl

public class HSSFBookImpl
extends org.zkoss.poi.hssf.usermodel.HSSFWorkbook
implements Book, BookCtrl

Implementation of Book based on HSSFWorkbook.

Author:
henrichen

Field Summary
 
Fields inherited from class org.zkoss.poi.hssf.usermodel.HSSFWorkbook
_sheets, INITIAL_CAPACITY
 
Fields inherited from class org.zkoss.poi.POIDocument
directory
 
Fields inherited from interface org.zkoss.poi.ss.usermodel.Workbook
PICTURE_TYPE_DIB, PICTURE_TYPE_EMF, PICTURE_TYPE_JPEG, PICTURE_TYPE_PICT, PICTURE_TYPE_PNG, PICTURE_TYPE_WMF, SHEET_STATE_HIDDEN, SHEET_STATE_VERY_HIDDEN, SHEET_STATE_VISIBLE
 
Fields inherited from interface org.zkoss.zss.model.impl.BookCtrl
CLASS
 
Constructor Summary
HSSFBookImpl(java.lang.String bookname, java.io.InputStream is)
           
 
Method Summary
 void addFocus(java.lang.Object focus)
           
 void addFunctionMapper(org.zkoss.xel.FunctionMapper mapper)
          Adds a function mapper to this model for the specified prefix.
 void addVariableResolver(org.zkoss.xel.VariableResolver resolver)
          Adds a variable resolver to this model.
 boolean containsFocus(java.lang.Object focus)
           
protected  org.zkoss.poi.hssf.usermodel.HSSFSheet createHSSFSheet(org.zkoss.poi.hssf.usermodel.HSSFWorkbook workbook)
           
protected  org.zkoss.poi.hssf.usermodel.HSSFSheet createHSSFSheet(org.zkoss.poi.hssf.usermodel.HSSFWorkbook workbook, org.zkoss.poi.hssf.model.InternalSheet sheet)
           
 void deletePictureData(org.zkoss.poi.ss.usermodel.PictureData img)
          Delete the PictureData.
 org.zkoss.poi.ss.usermodel.Font findFont(short boldWeight, org.zkoss.poi.ss.usermodel.Color color, short fontHeight, java.lang.String name, boolean italic, boolean strikeout, short typeOffset, byte underline)
          Finds a font that matches the one with the supplied attributes
 java.lang.String getBookName()
          Returns the associated book name of this spreadsheet book (important when used with @{link Books}).
 int getDefaultCharWidth()
          Returns default character width in pixel.
 org.zkoss.poi.ss.usermodel.Font getDefaultFont()
          Returns the default font used in this book.
 org.zkoss.poi.ss.usermodel.FormulaEvaluator getFormulaEvaluator()
          Returns the associated formula evaluator for this spreadsheet book.
 org.zkoss.poi.ss.util.CellRangeAddress getRepeatingRowsAndColumns(int sheetIndex)
          Returns the repeat rows and columns in a CellRangeAddress per the specified sheet; -1 mean no repeat rows or columns
 java.lang.String getShareScope()
          Returns share scope of this book.
 org.zkoss.poi.ss.SpreadsheetVersion getSpreadsheetVersion()
          Returns the spreadsheet version of this book (EXCEL97 or EXCEL2007).
 Worksheet getWorksheet(java.lang.String name)
          Returns ZK Spreadsheet Worksheet by name.
 Worksheet getWorksheetAt(int index)
          Returns ZK Spreadsheet Worksheet by index(0-based).
 boolean isDate1904()
          Gets a boolean value that indicates whether the date systems used in the workbook starts in 1904.
 RefBook newRefBook(Book book)
          Create an associated reference book.
 java.lang.String nextFocusId()
          Return next focus id for the UI.
 java.lang.String nextSheetId()
          Return next sheet id.
 void notifyChange(java.lang.String[] variables)
          Notify this book the value of the specified variable has changed.
 void removeFocus(java.lang.Object focus)
           
 void removeFunctionMapper(org.zkoss.xel.FunctionMapper mapper)
          Removes a function mapper to this model for the specified prefix.
 void removeSheetAt(int index)
           
 void removeVariableResolver(org.zkoss.xel.VariableResolver resolver)
          Removes a variable resolver to this model.
 void setDefaultFont(org.zkoss.poi.ss.usermodel.Font font)
          Sets the default font used in this book.
 void setShareScope(java.lang.String scope)
          Sets share scope of this book; default scope is EventQueues.DESKTOP.
 void setSheetName(int index, java.lang.String name)
           
 void subscribe(org.zkoss.zk.ui.event.EventListener listener)
          Subscribe a listener to listener to this book
 void unsubscribe(org.zkoss.zk.ui.event.EventListener listener)
          Unsubscribe the specified listener from listening to this book
 
Methods inherited from class org.zkoss.poi.hssf.usermodel.HSSFWorkbook
addPicture, addSSTString, addToolPack, changeExternalReference, cloneSheet, create, createCellStyle, createDataFormat, createFont, createName, createPivotCache, createSheet, createSheet, dumpDrawingGroupRecords, findFont, findSheetNameFromExternSheet, getActiveSheetIndex, getAllAutofilters, getAllEmbeddedObjects, getAllPictures, getBackupFlag, getBytes, getCellStyleAt, getCreationHelper, getCustomPalette, getDisplayedTab, getExternalSheetIndex, getFirstVisibleTab, getFontAt, getForceFormulaRecalculation, getMissingCellPolicy, getName, getNameAt, getNameIndex, getNameName, getNameRecord, getNumberOfFonts, getNumberOfNames, getNumberOfSheets, getNumCellStyles, getPivotCaches, getPrintArea, getSelectedTab, getSheet, getSheetAt, getSheetIndex, getSheetIndex, getSheetIndexFromExternSheetIndex, getSheetName, getSSTString, insertChartRecord, isHidden, isSheetHidden, isSheetVeryHidden, isWriteProtected, removeName, removeName, removePrintArea, resetFontCache, resolveNameXText, setActiveSheet, setBackupFlag, setDisplayedTab, setFirstVisibleTab, setForceFormulaRecalculation, setHidden, setMissingCellPolicy, setPrintArea, setPrintArea, setRepeatingRowsAndColumns, setSelectedTab, setSelectedTab, setSelectedTabs, setSheetHidden, setSheetHidden, setSheetOrder, unwriteProtectWorkbook, write, writeProtectWorkbook
 
Methods inherited from class org.zkoss.poi.POIDocument
copyNodeRecursively, copyNodes, copyNodes, createInformationProperties, getDocumentSummaryInformation, getPropertySet, getSummaryInformation, readProperties, writeProperties, writeProperties, writePropertySet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.zkoss.poi.ss.usermodel.Workbook
addPicture, addToolPack, cloneSheet, createCellStyle, createDataFormat, createFont, createName, createPivotCache, createSheet, createSheet, findFont, getActiveSheetIndex, getAllPictures, getCellStyleAt, getCreationHelper, getFirstVisibleTab, getFontAt, getForceFormulaRecalculation, getMissingCellPolicy, getName, getNameAt, getNameIndex, getNumberOfFonts, getNumberOfNames, getNumberOfSheets, getNumCellStyles, getPivotCaches, getPrintArea, getSheet, getSheetAt, getSheetIndex, getSheetIndex, getSheetName, isHidden, isSheetHidden, isSheetVeryHidden, removeName, removeName, removePrintArea, setActiveSheet, setFirstVisibleTab, setForceFormulaRecalculation, setHidden, setMissingCellPolicy, setPrintArea, setPrintArea, setRepeatingRowsAndColumns, setSelectedTab, setSheetHidden, setSheetHidden, setSheetOrder, write
 

Constructor Detail

HSSFBookImpl

public HSSFBookImpl(java.lang.String bookname,
                    java.io.InputStream is)
             throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getSpreadsheetVersion

public org.zkoss.poi.ss.SpreadsheetVersion getSpreadsheetVersion()
Description copied from interface: Book
Returns the spreadsheet version of this book (EXCEL97 or EXCEL2007).

Specified by:
getSpreadsheetVersion in interface Book
Returns:
the spreadsheet version of this book.

getBookName

public java.lang.String getBookName()
Description copied from interface: Book
Returns the associated book name of this spreadsheet book (important when used with @{link Books}).

Specified by:
getBookName in interface Book
Returns:
the associated book name of this spreadsheet book.

getFormulaEvaluator

public org.zkoss.poi.ss.usermodel.FormulaEvaluator getFormulaEvaluator()
Description copied from interface: Book
Returns the associated formula evaluator for this spreadsheet book.

Specified by:
getFormulaEvaluator in interface Book
Returns:
the associated formula evaluator for this spreadsheet book.

addFunctionMapper

public void addFunctionMapper(org.zkoss.xel.FunctionMapper mapper)
Description copied from interface: Book
Adds a function mapper to this model for the specified prefix. The first added function mapper has the highest priority.

Specified by:
addFunctionMapper in interface Book
Parameters:
mapper - the function mapper

addVariableResolver

public void addVariableResolver(org.zkoss.xel.VariableResolver resolver)
Description copied from interface: Book
Adds a variable resolver to this model. The first added variable resolver has the highest priority.

Specified by:
addVariableResolver in interface Book
Parameters:
resolver - the variable resolver to be added.

removeFunctionMapper

public void removeFunctionMapper(org.zkoss.xel.FunctionMapper mapper)
Description copied from interface: Book
Removes a function mapper to this model for the specified prefix.

Specified by:
removeFunctionMapper in interface Book
Parameters:
mapper - the function mapper.prefix the prefix of the specified mapper.

removeVariableResolver

public void removeVariableResolver(org.zkoss.xel.VariableResolver resolver)
Description copied from interface: Book
Removes a variable resolver to this model.

Specified by:
removeVariableResolver in interface Book
Parameters:
resolver - the variable resolver to be removed.

subscribe

public void subscribe(org.zkoss.zk.ui.event.EventListener listener)
Description copied from interface: Book
Subscribe a listener to listener to this book

Specified by:
subscribe in interface Book

unsubscribe

public void unsubscribe(org.zkoss.zk.ui.event.EventListener listener)
Description copied from interface: Book
Unsubscribe the specified listener from listening to this book

Specified by:
unsubscribe in interface Book

getDefaultFont

public org.zkoss.poi.ss.usermodel.Font getDefaultFont()
Description copied from interface: Book
Returns the default font used in this book.

Specified by:
getDefaultFont in interface Book
Returns:
the default font used in this book.

getDefaultCharWidth

public int getDefaultCharWidth()
Description copied from interface: Book
Returns default character width in pixel.

Specified by:
getDefaultCharWidth in interface Book
Returns:
default character width in pixel.

setDefaultFont

public void setDefaultFont(org.zkoss.poi.ss.usermodel.Font font)
Description copied from interface: Book
Sets the default font used in this book.

Specified by:
setDefaultFont in interface Book
Parameters:
font - the font to be used as the default font in this book.

notifyChange

public void notifyChange(java.lang.String[] variables)
Description copied from interface: Book
Notify this book the value of the specified variable has changed.

Specified by:
notifyChange in interface Book
Parameters:
variables - the variable names

getRepeatingRowsAndColumns

public org.zkoss.poi.ss.util.CellRangeAddress getRepeatingRowsAndColumns(int sheetIndex)
Description copied from interface: Book
Returns the repeat rows and columns in a CellRangeAddress per the specified sheet; -1 mean no repeat rows or columns

Specified by:
getRepeatingRowsAndColumns in interface Book
Parameters:
sheetIndex - the sheet index
Returns:
the repeat rows and columns in a CellRangeAddress;

deletePictureData

public void deletePictureData(org.zkoss.poi.ss.usermodel.PictureData img)
Description copied from interface: Book
Delete the PictureData.

Specified by:
deletePictureData in interface Book
Overrides:
deletePictureData in class org.zkoss.poi.hssf.usermodel.HSSFWorkbook

removeSheetAt

public void removeSheetAt(int index)
Specified by:
removeSheetAt in interface org.zkoss.poi.ss.usermodel.Workbook
Overrides:
removeSheetAt in class org.zkoss.poi.hssf.usermodel.HSSFWorkbook

setSheetName

public void setSheetName(int index,
                         java.lang.String name)
Specified by:
setSheetName in interface org.zkoss.poi.ss.usermodel.Workbook
Overrides:
setSheetName in class org.zkoss.poi.hssf.usermodel.HSSFWorkbook

createHSSFSheet

protected org.zkoss.poi.hssf.usermodel.HSSFSheet createHSSFSheet(org.zkoss.poi.hssf.usermodel.HSSFWorkbook workbook,
                                                                 org.zkoss.poi.hssf.model.InternalSheet sheet)
Overrides:
createHSSFSheet in class org.zkoss.poi.hssf.usermodel.HSSFWorkbook

createHSSFSheet

protected org.zkoss.poi.hssf.usermodel.HSSFSheet createHSSFSheet(org.zkoss.poi.hssf.usermodel.HSSFWorkbook workbook)
Overrides:
createHSSFSheet in class org.zkoss.poi.hssf.usermodel.HSSFWorkbook

findFont

public org.zkoss.poi.ss.usermodel.Font findFont(short boldWeight,
                                                org.zkoss.poi.ss.usermodel.Color color,
                                                short fontHeight,
                                                java.lang.String name,
                                                boolean italic,
                                                boolean strikeout,
                                                short typeOffset,
                                                byte underline)
Finds a font that matches the one with the supplied attributes

Specified by:
findFont in interface Book
Returns:
the font with the matched attributes or null

getShareScope

public java.lang.String getShareScope()
Description copied from interface: Book
Returns share scope of this book.

Note: this feature requires ZK Spreadsheet EE.

Specified by:
getShareScope in interface Book
See Also:
Book.setShareScope(String)

setShareScope

public void setShareScope(java.lang.String scope)
Description copied from interface: Book
Sets share scope of this book; default scope is EventQueues.DESKTOP.

Note: this feature requires ZK Spreadsheet EE.

Specified by:
setShareScope in interface Book
Parameters:
scope - share scope of this book: can be EventQueues.DESKTOP,EventQueues.GROUP,EventQueues.SESSION,EventQueues.APPLICATION.

getWorksheetAt

public Worksheet getWorksheetAt(int index)
Description copied from interface: Book
Returns ZK Spreadsheet Worksheet by index(0-based).

Specified by:
getWorksheetAt in interface Book

getWorksheet

public Worksheet getWorksheet(java.lang.String name)
Description copied from interface: Book
Returns ZK Spreadsheet Worksheet by name.

Specified by:
getWorksheet in interface Book

isDate1904

public boolean isDate1904()
Description copied from interface: Book
Gets a boolean value that indicates whether the date systems used in the workbook starts in 1904.

The default value is false, meaning that the workbook uses the 1900 date system, where 1/1/1900 is the first day in the system..

Specified by:
isDate1904 in interface Book
Returns:
true if the date systems used in the workbook starts in 1904

newRefBook

public RefBook newRefBook(Book book)
Description copied from interface: BookCtrl
Create an associated reference book.

Specified by:
newRefBook in interface BookCtrl
Parameters:
book - the ZK Spreadsheet book

nextSheetId

public java.lang.String nextSheetId()
Description copied from interface: BookCtrl
Return next sheet id.

Specified by:
nextSheetId in interface BookCtrl
Returns:
next sheet id.

nextFocusId

public java.lang.String nextFocusId()
Description copied from interface: BookCtrl
Return next focus id for the UI.

Specified by:
nextFocusId in interface BookCtrl
Returns:
next focus id.

addFocus

public void addFocus(java.lang.Object focus)
Specified by:
addFocus in interface BookCtrl

removeFocus

public void removeFocus(java.lang.Object focus)
Specified by:
removeFocus in interface BookCtrl

containsFocus

public boolean containsFocus(java.lang.Object focus)
Specified by:
containsFocus in interface BookCtrl


Copyright © 2005-2010 Potix Corporation. All Rights Reserved. SourceForge.net Logo