|
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.ExcelCell
This bean represents a cell in an Excel Worksheet. This bean uses the facilities provided by the ExcelWorkbook bean to access the cell. The sheet name and the range name identify the cell. If the range consists of more than one cell then this bean operates on the top-left cell in the range. The user of this bean needs to initialize (turn on) this bean before it can be used for accessing the range properties. Once the bean has been initialized, setting the properties of the range writes to the file.
This bean is similar in functionality to the ExcelRange bean, except that it operates on a single cell.
| Field Summary | |
protected java.beans.PropertyChangeSupport |
propertyChange
|
| Constructor Summary | |
ExcelCell()
Constructs an ExcelCell object with properties autoCreateSheet and autoUnprotectSheet set to false. |
|
| Method Summary | |
void |
addExcelCellErrorListener(ExcelCellErrorListener l)
Adds the specified ExcelCellErrorListener to receive ExcelCellError events from the ExcelCell bean. |
void |
addExcelCellListener(ExcelCellListener l)
Adds the specified ExcelCellListener to receive ExcelCell events from the ExcelCell bean. |
void |
addExcelSheetListener(ExcelSheetListener l)
Adds the specified ExcelSheetListener to receive ExcelSheet events from the ExcelRange bean. |
void |
addFetchArgumentsListener(FetchArgumentsListener l)
Adds the specified FetchArgumentsListener to receive FetchArguments events from the ExcelRange bean. |
void |
addFetchPasswordListener(FetchPasswordListener l)
Adds the specified FetchPasswordListener to receive FetchPassword events from the ExcelRange bean. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds the specified PropertyChangeListener to receive PropertyChange events from the ExcelRange bean. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
The addPropertyChangeListener method was generated to support the propertyChange field. |
void |
clear()
Clears all the cell properties (value, formula, format, text and noteText) for this Cell. |
void |
clearContents()
Clears the cell contents (value and formula, if any) for this Cell. |
void |
clearFormats()
Clears all cell formatting information for this cell, the value, noteText and formula are retained. |
void |
clearNotes()
Clears notetext for this cell, the value, formula and format information are retained. |
void |
createNamedCell(java.lang.String name)
Assigns a name to the current cell. |
void |
fillExcelFormatModel()
Fills the ExcelFormatModel bean from the cell. |
void |
firePropertyChange(java.beans.PropertyChangeEvent evt)
The firePropertyChange method was generated to support the propertyChange field. |
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
The firePropertyChange method was generated to support the propertyChange field. |
void |
firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
The firePropertyChange method was generated to support the propertyChange field. |
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()
Gets the aboutThisBean property (java.lang.String) value. |
java.util.Vector |
getColumnHeaders()
Returns a Vector of Strings, which represents the headers of the columns of the range (as integers). |
int |
getEndCol()
Returns the column number for the bottom right cell of the range. |
int |
getEndRow()
Returns the row number for the bottom right cell of the range. |
ExcelFormatModel |
getExcelFormatModel()
Gets the excelFormatModel property (com.ibm.excelaccessor.ExcelFormatModel) value. |
java.lang.String |
getFormat()
Returns the Format property of the cell as a String. |
java.lang.String |
getFormula()
Returns the Formula property for the Cell as a String. |
int |
getNCols()
Returns the number of columns present in the range. |
java.lang.String |
getNoteText()
Returns the noteText for the cell. |
int |
getNRows()
Returns the number of rows present in the range. |
protected java.beans.PropertyChangeSupport |
getPropertyChange()
Accessor for the propertyChange field. |
java.lang.String |
getRangeName()
Returns the name of the range if the range has been selected using rangeName. |
java.util.Vector |
getRowHeaders()
Returns a Vector of Strings, which represents the headers of the rows of the range (as integers). |
int |
getStartCol()
Returns the column number for the top left cell of the range. |
int |
getStartRow()
Returns the row number for the top left cell of the range. |
java.lang.String |
getText()
Returns the Text property for the Range. |
java.lang.Object |
getValue()
Returns the Value property for the Range. |
java.lang.String |
getWorksheetName()
Returns the name of the worksheet. |
java.lang.Boolean |
hasArray()
Method to check whether the cell is part of an array. |
java.lang.Boolean |
hasFormula()
Method to check whether the cell contains a formula. |
boolean |
hasListeners(java.lang.String propertyName)
The hasListeners method was generated to support the propertyChange field. |
void |
initCell()
A call to this method initializes the cell bean and essentially turns it on for further use. |
void |
insertWorksheet()
Inserts a new worksheet in the workbook and renames it to the worksheetName of this range. |
boolean |
isAutoCreateSheet()
Returns the value of the autoCreateSheet property. |
boolean |
isAutoUnprotectSheet()
Returns the value of the autoUnprotectSheet property. |
boolean |
isInitialized()
Returns the status of the initialization of the cell bean. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
The listener method for property change events. |
void |
removeExcelCellErrorListener(ExcelCellErrorListener l)
Removes the specified ExcelCellErrorListener so that it no longer receives ExcelCellErrorEvents from this bean. |
void |
removeExcelCellListener(ExcelCellListener l)
Removes the specified ExcelCellListener so that it no longer receives ExcelCellEvents from this bean. |
void |
removeExcelSheetListener(ExcelSheetListener l)
Removes the specified ExcelSheetListener so that it no longer receives ExcelSheetEvents from this bean. |
void |
removeFetchArgumentsListener(FetchArgumentsListener l)
Removes the specified FetchArgumentsListener so that it no longer receives FetchArgumentsEvents from this bean. |
void |
removeFetchPasswordListener(FetchPasswordListener l)
Removes the specified FetchPasswordListener so that it no longer receives FetchPasswordEvents from this bean. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes the specified PropertyChangeListener so that it no longer receives PropertyChangeEvents from this bean. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field. |
void |
removeWorksheet()
Removes a worksheet from the workbook. |
void |
saveExcelFormatModel()
Saves the content of the contained ExcelFormatModel bean to the cell. |
void |
setAboutThisBean(java.lang.String aboutThisBean)
Sets the aboutThisBean property (java.lang.String) value. |
void |
setAutoCreateSheet(boolean bValue)
Sets the value of the autoCreateSheet property. |
void |
setAutoUnprotectSheet(boolean bValue)
Sets the value of the autoUnprotectSheet property. |
void |
setCellR1C1(int row,
int col)
This method can be used to identify a single cell as the range to be accessed using the cell row and column numbers. |
void |
setExcelFormatModel(ExcelFormatModel excelFormatModel)
Sets the excelFormatModel property (com.ibm.excelaccessor.ExcelFormatModel) value. |
void |
setFormat(java.lang.String strFormat)
Sets the format property of this cell. |
void |
setFormula(java.lang.String strFormula)
Sets the formula property of the cell. |
void |
setNoteText(java.lang.String strText)
Sets the noteText for the cell. |
void |
setRangeName(java.lang.String strName)
Sets the name of the Range to be accessed. |
void |
setRangeR1C1(int topRow,
int leftCol,
int bottomRow,
int rightCol)
This method can be used to identify the range to be accessed using the positions of the top-left and bottom-right cells. |
void |
setValue(java.lang.Object objValue)
Sets the value property of this cell. |
void |
setWorksheetName(java.lang.String strName)
Sets the name of the worksheet to be accessed. |
void |
setWorksheetProtectionPassword(java.lang.String strPass)
Sets the worksheet protection password to be used while unprotecting the worksheet. |
void |
setXlWorkbook(ExcelWorkbook workbookBean)
Sets the reference to the ExcelWorkbook bean that this cell bean operates on. |
void |
unprotectWorksheet()
Unprotects the worksheet. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected transient java.beans.PropertyChangeSupport propertyChange
| Constructor Detail |
public ExcelCell()
| Method Detail |
public void addExcelCellErrorListener(ExcelCellErrorListener l)
l - The ExcelCellErrorEvent listener.ExcelCellErrorEvent,
ExcelCellErrorListenerpublic void addExcelCellListener(ExcelCellListener l)
l - the ExcelCellEvent listener.ExcelCellEvent,
ExcelCellListenerpublic void addExcelSheetListener(ExcelSheetListener l)
l - The ExcelSheetEvent listener.ExcelSheetEvent,
ExcelSheetListenerpublic void addFetchArgumentsListener(FetchArgumentsListener l)
l - The FetchArgumentsEvent listener.FetchArgumentsEvent,
FetchArgumentsListenerpublic void addFetchPasswordListener(FetchPasswordListener l)
l - The FetchPasswordEvent listener.FetchPasswordEvent,
FetchPasswordListenerpublic void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l - The PropertyChangeEvent listener.PropertyChangeEvent,
PropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
public void clear()
public void clearContents()
public void clearFormats()
public void clearNotes()
public void createNamedCell(java.lang.String name)
name - The name to be assigned to this cell.
public void fillExcelFormatModel()
throws ExcelAccessorException
ExcelAccessorException - Exception is thrown if
the ExcelCell bean itself is not in initialized state, or when an error occurs
while the bean accessing the workbook.public void firePropertyChange(java.beans.PropertyChangeEvent evt)
public void firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
public void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
public void firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
public java.lang.String getAboutThisBean()
setAboutThisBean(java.lang.String)public java.util.Vector getColumnHeaders()
public int getEndCol()
public int getEndRow()
public ExcelFormatModel getExcelFormatModel()
setExcelFormatModel(com.ibm.excelaccessor.ExcelFormatModel)public java.lang.String getFormat()
public java.lang.String getFormula()
public int getNCols()
public java.lang.String getNoteText()
public int getNRows()
protected java.beans.PropertyChangeSupport getPropertyChange()
public java.lang.String getRangeName()
public java.util.Vector getRowHeaders()
public int getStartCol()
public int getStartRow()
public java.lang.String getText()
public java.lang.Object getValue()
public java.lang.String getWorksheetName()
public java.lang.Boolean hasArray()
public java.lang.Boolean hasFormula()
public boolean hasListeners(java.lang.String propertyName)
public void initCell()
autoUnprotect is true it tries to
unprotect the sheet. If unprotection fails an error event is fired
and cell initialization continues.
This method has to be called before this bean can be used in
a valid manner to access the properties of the cell.
It fires cellInitialized( ExcelCellEvent ) on successful
initialization.
It fires ExcelCellErrorEvent on failure.FetchArgumentsEvent,
ExcelCellErrorEvent,
ExcelCellEventpublic void insertWorksheet()
ExcelSheetEventpublic boolean isAutoCreateSheet()
autoCreateSheet property.public boolean isAutoUnprotectSheet()
autoUnprotectSheet property.public boolean isInitialized()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerevt - The PropertyChangeEvent.public void removeExcelCellErrorListener(ExcelCellErrorListener l)
l - The ExcelCellErrorListener.ExcelCellErrorEvent,
ExcelCellErrorListenerpublic void removeExcelCellListener(ExcelCellListener l)
l - the ExcelCellListener.ExcelCellEvent,
ExcelCellListenerpublic void removeExcelSheetListener(ExcelSheetListener l)
l - The ExcelSheetListener.ExcelSheetEvent,
ExcelSheetListenerpublic void removeFetchArgumentsListener(FetchArgumentsListener l)
l - The FetchArgumentsListener.FetchArgumentsEvent,
FetchArgumentsListenerpublic void removeFetchPasswordListener(FetchPasswordListener l)
l - the FetchPasswordListener.FetchPasswordEvent,
FetchPasswordListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l - the PropertyChangeListener.PropertyChangeEvent,
PropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
public void removeWorksheet()
worksheetName. The cell bean need not be
initialized to perform this operation. Before removing
the sheet, the FetchArgumentsEvent is fired which can be
used to set the worksheetName. During removal, if the
workbook structure is protected, it is
automatically unprotected. It fires sheetRemoved (ExcelSheetEvent)
on success. It fires ExcelCellErrorEvent if an error occurs.ExcelSheetEvent
public void saveExcelFormatModel()
throws ExcelAccessorException
ExcelAccessorException - Exception is thrown if
the ExcelCell bean itself is not in initialized state, if the contained ExcelFormatModel
bean is not in initialized state, if the dimension of the ExcelFormatModel bean is not
(1, 1) - that is this.getExcelFormatModel().getRowCount() == 1 and
this.getExcelFormatModel().getColumnCount() == 1 -
or when an error occurs while the bean accessing the workbook.public void setAboutThisBean(java.lang.String aboutThisBean)
aboutThisBean - The new value for the property.getAboutThisBean()public void setAutoCreateSheet(boolean bValue)
bValue - The value to set.public void setAutoUnprotectSheet(boolean bValue)
bValue - The value to set.
public void setCellR1C1(int row,
int col)
row - The row number of the cell.col - The column number of the cell.public void setExcelFormatModel(ExcelFormatModel excelFormatModel)
excelFormatModel - The new value for the property.getExcelFormatModel()public void setFormat(java.lang.String strFormat)
strFormat - String specifying the format.public void setFormula(java.lang.String strFormula)
strFormula - A String specifying the formula.public void setNoteText(java.lang.String strText)
strText - String containing the noteText.public void setRangeName(java.lang.String strName)
If the range contains multiple contiguous cells (such as a range "B4:F6") then the ExcelCell bean operates on the top-left cell of the range.
(Note: The beans do not have support for ranges that are composed of multiple areas.)strName - The name of the Range to be accessed.
public void setRangeR1C1(int topRow,
int leftCol,
int bottomRow,
int rightCol)
If the range contains multiple contiguous cells then the ExcelCell bean operates on the top-left cell of the range.
topRow - The row number of the top-left corner of
the range.leftCol - The column number of the top-left corner of
the range.bottomRow - The row number of the bottom right corner of
the range.rightCol - The column number of the bottom right corner of
the range.public void setValue(java.lang.Object objValue)
objValue - the Object containing the value to be written.public void setWorksheetName(java.lang.String strName)
strName - The name of the worksheet to be accessed.public void setWorksheetProtectionPassword(java.lang.String strPass)
strPass - The worksheet protection password.public void setXlWorkbook(ExcelWorkbook workbookBean)
workbookBean - The ExcelWorkbook on which all operations will
be performedpublic void unprotectWorksheet()
|
ExcelAccessor Bean Suite | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||