|
ExcelAccessor Bean Suite | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.excelaccessor.ExcelWorkbook
The ExcelWorkbook class is a bean belonging to the ExcelAccessor
bean suite. This class should be used along with the ExcelRange
bean to access the workbook.
This class handles all the Workbook operation such as
opening, saving and closing the workbook.
At the time of opening the workbook, it fires the FetchPassword
event if the Workbook has a protection password. It also fires
this event in case the Workbook has a write reservation password
and it is being opened in read-write mode. If the workbook is being
opened in the write mode, this bean ignores any readOnlyRecommended
status for the file. It also fires this event in case the Workbook
has a structure/window protection password for the workbook
modification such as inserting or removing a sheet.
At the time of closing the workbook, it throws a FileSavingEvent if
the file has been modified. This event could be wired to set the
saveOnClose property. By default, this property is set to true
(i.e. the workbook will be saved).
This bean automatically opens the workbook when it is first
accessed, if it has not already been opened specifically.
This class also contains methods that the other beans can call to
access the excel workbook. These methods in turn call the native
methods.
FetchPasswordEvent,
FetchPasswordListener,
FileSavingEvent,
FileSavingListener, Serialized Form| Field Summary | |
protected java.beans.PropertyChangeSupport |
propertyChange
|
| Constructor Summary | |
ExcelWorkbook()
Constructs an ExcelWorkbook with the readOnly and the saveOnClose flags set to true. |
|
| Method Summary | |
void |
addExcelWorkbookErrorListener(ExcelWorkbookErrorListener l)
Add the specified ExcelWorkbookError listener to receive ExcelWorkbookError events from the ExcelWorkbook bean. |
void |
addExcelWorkbookListener(ExcelWorkbookListener l)
Adds the specified ExcelWorkbook listener to receive ExcelWorkbook events from the ExcelWorkbook bean. |
void |
addFetchArgumentsListener(FetchArgumentsListener l)
Adds the specified FetchArguments listener to receive FetchArgument events from the ExcelWorkbook bean. |
void |
addFetchPasswordListener(FetchPasswordListener l)
Adds the specified FetchPassword listener to receive FetchPassword events from the ExcelWorkbook bean. |
void |
addFileSavingListener(FileSavingListener l)
Adds the specified FileSaving listener to receive FileSaving events from the ExcelWorkbook bean. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds the specified PropertyChange listener to receive PropertyChange events from the ExcelWorkbook bean. |
void |
closeExcelApplication()
The method to close the application. |
void |
closeWorkbook()
The method to close the workbook. |
void |
finalize()
The method is called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
The firePropertyChange method was generated to support the propertyChange field. |
java.lang.String |
getAboutThisBean()
|
protected java.beans.PropertyChangeSupport |
getPropertyChange()
Accessor for the propertyChange field. |
ExcelWorkbook |
getThisWorkbook()
Returns the reference to this workbook. |
java.lang.String |
getWorkbookName()
Returns the workbook name |
java.lang.String[] |
getWorksheets()
Returns the worksheets in the current workbook. |
boolean |
isExcelfile(java.lang.String file_name)
This method was created in VisualAge. |
boolean |
isOpened()
Returns the status of the workbook |
boolean |
isReadOnly()
Returns the flag indicating the workbook access mode. |
boolean |
isSaveOnClose()
Returns the flag indicating whether the workbook should be saved or not. |
void |
newWorkbook()
This method is called to create the new Workbook. |
void |
openWorkbook()
This method is called to open the Workbook. |
void |
removeExcelWorkbookErrorListener(ExcelWorkbookErrorListener l)
Removes the specified ExcelWorkbookError listener so that it no longer receives ExcelWorkbookError events from this bean. |
void |
removeExcelWorkbookListener(ExcelWorkbookListener l)
Removes the specified ExcelWorkbook listener so that it no longer receives ExcelWorkbook events from this bean. |
void |
removeFetchArgumentsListener(FetchArgumentsListener l)
Removes the specified FetchArguments listener so that it no longer receives FetchArguments events from this bean. |
void |
removeFetchPasswordListener(FetchPasswordListener l)
Removes the specified FetchPassword listener so that it no longer receives FetchPassword events from this bean. |
void |
removeFileSavingListener(FileSavingListener l)
Removes the specified FileSaving listener so that it no longer receives FileSaving events from this bean. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes the specified PropertyChange listener so that it no longer receives PropertyChange events from this bean. |
void |
setAboutThisBean(java.lang.String aboutThisBean)
|
void |
setReadOnly(boolean b)
Sets the flag indicating the mode that the workbook should be opened in. |
void |
setSaveOnClose(boolean b)
Sets the flag indicating whether the workbook should be saved before closing. |
void |
setWorkbookName(java.lang.String name)
Sets the name of the workbook. |
void |
setWorkbookProtectionPassword(java.lang.String pass)
Sets the Workbook ProtectionPassword. |
void |
setWorkbookStructureProtectionPassword(java.lang.String pass)
Stores the Workbook StructureProtectionPassword. |
void |
setWorkbookWriteReservationPassword(java.lang.String pass)
Stores the Workbook WriteReservationPassword. |
void |
unprotectWorkbookStructure()
This method unprotects the workbook structure/windows. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected transient java.beans.PropertyChangeSupport propertyChange
| Constructor Detail |
public ExcelWorkbook()
| Method Detail |
public void addExcelWorkbookErrorListener(ExcelWorkbookErrorListener l)
l - The ExcelAccessorErrorListener to be addedExcelWorkbookErrorEvent,
ExcelWorkbookErrorListenerpublic void addExcelWorkbookListener(ExcelWorkbookListener l)
l - the ExcelWorkbook listener.ExcelWorkbookEvent,
ExcelWorkbookListenerpublic void addFetchArgumentsListener(FetchArgumentsListener l)
l - The FetchArgumentsListener to be added.FetchArgumentsEvent,
FetchArgumentsListenerpublic void addFetchPasswordListener(FetchPasswordListener l)
l - The FetchPasswordListener to be added.FetchPasswordEvent,
FetchPasswordListenerpublic void addFileSavingListener(FileSavingListener l)
l - the FileSaving listener.FileSavingEvent,
FileSavingListenerpublic void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l - The PropertyChangeListener to be addedPropertyChangeEvent,
PropertyChangeListenerpublic void closeExcelApplication()
FileSavingEvent,
FileSavingListenerpublic void closeWorkbook()
saveOnClose flag is true.
This method should be called to ensure that changes made
to the workbook are not lost.FileSavingEvent,
FileSavingListenerpublic void finalize()
finalize in class java.lang.Object
public void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
public java.lang.String getAboutThisBean()
protected java.beans.PropertyChangeSupport getPropertyChange()
public ExcelWorkbook getThisWorkbook()
this workbook referencepublic java.lang.String getWorkbookName()
public java.lang.String[] getWorksheets()
null if the workbook is not open.public boolean isExcelfile(java.lang.String file_name)
public boolean isOpened()
public boolean isReadOnly()
readOnly propertypublic boolean isSaveOnClose()
saveOnClose propertypublic void newWorkbook()
ExcelWorkbookErrorListenerpublic void openWorkbook()
FetchPasswordListener,
ExcelWorkbookErrorListenerpublic void removeExcelWorkbookErrorListener(ExcelWorkbookErrorListener l)
l - The ExcelWorkbookErrorListener to be removedExcelWorkbookErrorEvent,
ExcelWorkbookErrorListenerpublic void removeExcelWorkbookListener(ExcelWorkbookListener l)
l - The ExcelWorkbookListener to be removedExcelWorkbookEvent,
ExcelWorkbookListenerpublic void removeFetchArgumentsListener(FetchArgumentsListener l)
l - The FetchArgumentsListener to be removedFetchArgumentsEvent,
FetchArgumentsListenerpublic void removeFetchPasswordListener(FetchPasswordListener l)
l - The FetchPasswordListener to be removedFetchPasswordEvent,
FetchPasswordListenerpublic void removeFileSavingListener(FileSavingListener l)
l - The FileSavingListener to be removedFileSavingEvent,
FileSavingListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
listener - The PropertyChangeListener to be removedPropertyChangeEvent,
PropertyChangeListenerpublic void setAboutThisBean(java.lang.String aboutThisBean)
public void setReadOnly(boolean b)
b - The boolean parameterpublic void setSaveOnClose(boolean b)
b - The boolean parameterpublic void setWorkbookName(java.lang.String name)
name - The String specifying the workbookNamepublic void setWorkbookProtectionPassword(java.lang.String pass)
pass - The String specifying the workbookProtection passwordpublic void setWorkbookStructureProtectionPassword(java.lang.String pass)
pass - The String specifying the workbookStructureProtection
passwordpublic void setWorkbookWriteReservationPassword(java.lang.String pass)
pass - The String specifying the
workbookWriteReservationProtection passwordpublic void unprotectWorkbookStructure()
FetchPasswordListener
|
ExcelAccessor Bean Suite | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||