|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsheets.ext.CellExtension
public abstract class CellExtension
A base class for extensions of cells in a spreadsheet that uses delegation to provide cell data.
| Constructor Summary | |
|---|---|
CellExtension(Cell delegate,
String name)
Creates a new cell extension. |
|
| Method Summary | |
|---|---|
void |
addCellListener(CellListener listener)
Registers the given listener on the cell. |
void |
cellCleared(Cell cell)
Invoked when a cell has been cleared. |
void |
cellCopied(Cell cell,
Cell source)
Invoked when a cell has been copied. |
void |
clear()
Clears the content of the cell. |
int |
compareTo(Cell cell)
|
void |
contentChanged(Cell cell)
Invoked when the content of a cell has been changed. |
void |
copyFrom(Cell source)
Copies all data from the source cell to this one. |
void |
dependentsChanged(Cell cell)
Invoked when a new dependent has been registered on a cell, or when an old one has been removed. |
Address |
getAddress()
Returns the address of the cell. |
CellListener[] |
getCellListeners()
Returns the listeners that have been registered on the cell. |
String |
getContent()
Returns the content of the cell, as entered by the user. |
Cell |
getDelegate()
Returns the extension's delegate. |
SortedSet<Cell> |
getDependents()
Returns the dependents of the cell, i.e. the cells that contain a reference to the cell in their formula. |
Cell |
getExtension(String name)
Returns the extension with the given key. |
Formula |
getFormula()
Returns an expression representing the cell's formula. |
String |
getName()
Returns the name of the extension to which the cell extension belongs. |
SortedSet<Cell> |
getPrecedents()
Returns the precedents of the cell, i.e. the cells that the formula in the cell references. |
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet to which the cell belongs. |
Value |
getValue()
Returns the value of the cell. |
void |
moveFrom(Cell source)
Moves all data from the source cell to this one. |
void |
removeCellListener(CellListener listener)
Removes the given listener from the cell. |
void |
setContent(String content)
Sets the content of the cell and if it starts with the assignment operator attempts to parse a formula from it. |
String |
toString()
|
void |
valueChanged(Cell cell)
Invoked when the value of a cell has changed, either by a change in its content, or by a change of value in one of its precedents. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CellExtension(Cell delegate,
String name)
delegate - the delegate of the extensionname - the name of the extension to which the cell extension belongs| Method Detail |
|---|
public final Cell getDelegate()
public final String getName()
public final Spreadsheet getSpreadsheet()
Cell
getSpreadsheet in interface Cellpublic final Address getAddress()
Cell
getAddress in interface Cellpublic final Value getValue()
Cell
getValue in interface Cellpublic final String getContent()
Cell
getContent in interface Cellpublic final Formula getFormula()
Cell
getFormula in interface Cell
public final void setContent(String content)
throws FormulaCompilationException
Cell
setContent in interface CellFormulaCompilationException - if an incorrectly formatted formula was enteredpublic void clear()
Cell
clear in interface Cellpublic final SortedSet<Cell> getPrecedents()
Cell
getPrecedents in interface Cellpublic final SortedSet<Cell> getDependents()
Cell
getDependents in interface Cellpublic final void copyFrom(Cell source)
Cell
copyFrom in interface Cellsource - the cell from which data should be copiedpublic final void moveFrom(Cell source)
Cell
moveFrom in interface Cellsource - the cell from which data should be movedpublic final void addCellListener(CellListener listener)
Cell
addCellListener in interface Celllistener - the listener to be addedpublic final void removeCellListener(CellListener listener)
Cell
removeCellListener in interface Celllistener - the listener to be removedpublic final CellListener[] getCellListeners()
Cell
getCellListeners in interface Cellpublic final Cell getExtension(String name)
Extensible
getExtension in interface Extensible<Cell>name - the name of the extension (case-insensitive)
public final int compareTo(Cell cell)
compareTo in interface Comparable<Cell>public final String toString()
toString in class Objectpublic void valueChanged(Cell cell)
CellListener
valueChanged in interface CellListenercell - the cell that was modifiedpublic void contentChanged(Cell cell)
CellListener
contentChanged in interface CellListenercell - the cell that was modifiedpublic void dependentsChanged(Cell cell)
CellListener
dependentsChanged in interface CellListenercell - the cell that was modifiedpublic void cellCleared(Cell cell)
CellListener
cellCleared in interface CellListenercell - the cell that was modified
public void cellCopied(Cell cell,
Cell source)
CellListener
cellCopied in interface CellListenercell - the cell that was modifiedsource - the cell from which data was copied
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||