|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jniwrapper.win32.jexcel.BaseClass
com.jniwrapper.win32.jexcel.Workbook
This class provides functionality for working with an Excel workbook.
| Constructor Summary | |
Workbook(com.jniwrapper.win32.automation.IDispatch workbook,
Application application)
|
|
| Method Summary | |
void |
activate()
Activates the workbook. |
void |
addWorkbookEventListener(WorkbookEventListener eventListener)
Adds the listener of workbook events. |
Worksheet |
addWorksheet(java.lang.String name)
Adds a worksheet to the workbook. |
Worksheet |
addWorksheet(Worksheet after,
java.lang.String name)
Adds a worksheet to the workbook. |
void |
close(boolean saveChanges)
Closes the workbook and optionally saves changes. |
boolean |
equals(java.lang.Object obj)
|
Worksheet |
getActiveWorksheet()
Returns the active worksheet. |
Application |
getApplication()
Returns the parent application. |
java.lang.String |
getAuthor()
Returns the workbook author name. |
java.io.File |
getFile()
Returns the workbook file. |
FileFormat |
getFileFormat()
Returns the format of the workbook file. |
com.jniwrapper.win32.excel._Workbook |
getNativePeer()
Returns the appropriate native peer. |
com.jniwrapper.win32.automation.OleMessageLoop |
getOleMessageLoop()
Returns the message loop thread for processing native peer function calls. |
java.lang.String |
getTitle()
Returns the currently set title of the workbook. |
Window |
getWindow()
Returns the windows that corresponds to the workbook. |
java.lang.String |
getWorkbookName()
Returns the name of the workbook. |
Worksheet |
getWorksheet(int index)
Returns the worksheet that is specified by its index. |
Worksheet |
getWorksheet(java.lang.String name)
Returns the worksheet that is specified by its name. |
int |
getWorksheetCount()
Returns the number of worksheets in the workbook. |
java.util.List |
getWorksheets()
Returns the list of worksheets of the workbook. |
int |
hashCode()
|
boolean |
hasPassword()
Returns true if the workbook has a password. |
boolean |
isClosed()
Checks if the workbook is closed. |
boolean |
isReadOnly()
Checks if the workbook is read only. |
boolean |
isSaved()
Checks if the workbook is saved (have not benn changed since the last save operation). |
void |
moveWorksheet(Worksheet worksheet,
Worksheet after)
Moves the worksheet to the position after the specified worksheet. |
void |
print(int copies)
Prints the specified number of copies of the workbook. |
void |
print(int firstSheet,
int lastSheet,
int copies)
Prints the specified range of worksheet. |
void |
removeEventHandler()
Removes the handler of workbook events. |
void |
removeWorkbookEventListener(WorkbookEventListener eventListener)
Removes the specified listener of workbook events. |
void |
removeWorksheet(Worksheet worksheet)
Removes the worksheet from the workbook. |
void |
save()
Saves changes in all worksheets of the workbook. |
void |
saveAs(java.io.File file,
FileFormat fileFormat,
boolean overwrite)
Saves the workbook to the file that is specified by the file argument. |
com.jniwrapper.win32.HResult |
saveCopyAs(java.io.File file)
Saves a copy of the workbook to another file. |
void |
setAuthor(java.lang.String author)
Specifies the workbook author name. |
void |
setEventHandler(WorkbookEventHandler eventHandler)
Specifies the handler of workbook events. |
void |
setPassword(java.lang.String password)
Sets up the password of the workbook. |
void |
setSaved(boolean value)
Force setting workbook "saved" status |
void |
setTitle(java.lang.String title)
Sets up the title of the workbook. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.jniwrapper.win32.jexcel.GenericWorkbook |
getApplication |
| Constructor Detail |
public Workbook(com.jniwrapper.win32.automation.IDispatch workbook,
Application application)
| Method Detail |
public Worksheet addWorksheet(java.lang.String name)
throws ExcelException
GenericWorkbook
addWorksheet in interface GenericWorkbookname - is the name of a new worksheet.
ExcelException - if a worksheet with such name already exists in the workbook.
public Worksheet addWorksheet(Worksheet after,
java.lang.String name)
throws ExcelException
GenericWorkbook
addWorksheet in interface GenericWorkbookafter - the worksheet will be added to the position after this worksheet.
If the value is null, the worksheet will be added
at the beginning of the worksheet list.name - is the name of a new worksheet.
ExcelException - if a worksheet with such name already exists in the workbook.public Worksheet getWorksheet(java.lang.String name)
GenericWorkbooknull.
getWorksheet in interface GenericWorkbookname - is the name of the worksheet.
null if such worksheet is not present.public java.util.List getWorksheets()
GenericWorkbookWorksheet class.
getWorksheets in interface GenericWorkbookpublic Worksheet getWorksheet(int index)
GenericWorkbook
getWorksheet in interface GenericWorkbookindex - is the index of the worksheet.
public Worksheet getActiveWorksheet()
GenericWorkbook
getActiveWorksheet in interface GenericWorkbookpublic void setEventHandler(WorkbookEventHandler eventHandler)
GenericWorkbook
setEventHandler in interface GenericWorkbookeventHandler - public void removeEventHandler()
GenericWorkbook
removeEventHandler in interface GenericWorkbookpublic void addWorkbookEventListener(WorkbookEventListener eventListener)
GenericWorkbook
addWorkbookEventListener in interface GenericWorkbookeventListener - public void removeWorkbookEventListener(WorkbookEventListener eventListener)
GenericWorkbook
removeWorkbookEventListener in interface GenericWorkbookeventListener - is the listener to be removed.public void setTitle(java.lang.String title)
GenericWorkbook
setTitle in interface GenericWorkbooktitle - is a new title of the workbook.public java.lang.String getTitle()
GenericWorkbook
getTitle in interface GenericWorkbookpublic java.io.File getFile()
GenericWorkbook
getFile in interface GenericWorkbookpublic FileFormat getFileFormat()
GenericWorkbook
getFileFormat in interface GenericWorkbook
public void print(int copies)
throws javax.print.PrintException
GenericWorkbook
print in interface GenericWorkbookcopies - is the number of copies to be printered.
javax.print.PrintException - if print problems occured.
public void print(int firstSheet,
int lastSheet,
int copies)
throws javax.print.PrintException
GenericWorkbook
print in interface GenericWorkbookfirstSheet - is the index of the first worksheet to be printered.lastSheet - is the index of the last worksheet to be printered.copies - is the number of copies to be printered.
javax.print.PrintException - if print problems occured.public int getWorksheetCount()
GenericWorkbook
getWorksheetCount in interface GenericWorkbookpublic void setPassword(java.lang.String password)
GenericWorkbook
setPassword in interface GenericWorkbookpassword - is a new password to be set up.public boolean hasPassword()
GenericWorkbooktrue if the workbook has a password.
hasPassword in interface GenericWorkbooktrue if the workbook has a password.public java.lang.String getWorkbookName()
GenericWorkbook
getWorkbookName in interface GenericWorkbookpublic boolean isReadOnly()
GenericWorkbook
isReadOnly in interface GenericWorkbooktrue if the workbook is read only.public boolean isSaved()
GenericWorkbook
isSaved in interface GenericWorkbooktrue if the workbook is saved.public void setSaved(boolean value)
value - - true to set saved and otherwise.public boolean isClosed()
GenericWorkbook
isClosed in interface GenericWorkbooktrue if the workbook is closed.public void close(boolean saveChanges)
saveChanges - specifies whether to save changes on closing.
java.lang.IllegalStateException - if the workbook is already closed.
public void save()
throws java.io.IOException
java.lang.IllegalStateException - if the workbook is closed.
java.io.IOException - if the workbook cannot be saved to the specified file.
public void saveAs(java.io.File file,
FileFormat fileFormat,
boolean overwrite)
throws java.io.IOException
file argument.
file - specifies the file name.fileFormat - specifies the file format.overwrite - if true then an existing file will be overwritten.
java.lang.IllegalStateException - if the workbook is closed.
java.io.IOException - if the workbook cannot be saved to the specified file.FileFormat
public com.jniwrapper.win32.HResult saveCopyAs(java.io.File file)
throws java.io.IOException
GenericWorkbook
saveCopyAs in interface GenericWorkbookfile - specifies the file name.
java.io.IOException - if the workbook cannot be saved to the specified file.public void activate()
GenericWorkbook
activate in interface GenericWorkbookpublic Window getWindow()
GenericWorkbook
getWindow in interface GenericWorkbookWindowpublic java.lang.String getAuthor()
GenericWorkbook
getAuthor in interface GenericWorkbookpublic void setAuthor(java.lang.String author)
GenericWorkbook
setAuthor in interface GenericWorkbookauthor - is the workbook author name.public void removeWorksheet(Worksheet worksheet)
GenericWorkbook
removeWorksheet in interface GenericWorkbookworksheet - specifies the worksheet to be removed.
public void moveWorksheet(Worksheet worksheet,
Worksheet after)
GenericWorkbook
moveWorksheet in interface GenericWorkbookworksheet - specifies the worksheet to be moved.after - the worksheet will be moved to the position after this worksheet.
If the value is null, the worksheet will be moved
to the beginning of the worksheet list.public com.jniwrapper.win32.excel._Workbook getNativePeer()
public boolean equals(java.lang.Object obj)
public int hashCode()
public com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop()
public Application getApplication()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||