|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object extended by org.jopendocument.dom.ODNode extended by org.jopendocument.dom.StyledNode<S,D> extended by org.jopendocument.dom.ImmutableDocStyledNode<S,D> extended by org.jopendocument.dom.spreadsheet.Cell<D> extended by org.jopendocument.dom.spreadsheet.MutableCell<D>
D - type of documentpublic class MutableCell<D extends ODDocument>
A cell whose value can be changed.
| Method Summary | |
|---|---|
void |
clearValue()
|
static String |
formatCurrency(Number n,
CellStyle defaultStyle)
|
static String |
formatNumber(Number n,
CellStyle defaultStyle)
|
static String |
formatPercent(Number n,
CellStyle defaultStyle)
|
DataStyle |
getDataStyle()
|
protected CellStyle |
getDefaultStyle()
|
Point |
getPoint()
|
String |
getStyleName()
|
protected org.jdom.Namespace |
getTABLE()
|
CellStyle.StyleTableCellProperties |
getTableCellProperties()
|
static boolean |
getTimeValueMode()
Whether setValue(Object) formats Duration using the standard way or using
the LibreOffice way. |
int |
getX()
|
int |
getY()
|
void |
merge(int columnsSpanned,
int rowsSpanned)
Merge this cell and the following ones. |
void |
replaceBy(String oldValue,
String newValue)
|
void |
setBackgroundColor(Color color)
|
void |
setFormula(String formula)
|
void |
setFormulaAndNamespace(org.jdom.Namespace ns,
String formula)
|
void |
setFormulaAndNamespace(Tuple2<org.jdom.Namespace,String> formula)
|
void |
setImage(File pic)
|
void |
setImage(File pic,
boolean keepRatio)
|
void |
setImage(String name,
Image img)
|
void |
setRawFormula(String formula)
Set the raw value of the formula attribute. |
static void |
setTimeValueMode(boolean loMode)
|
void |
setValue(Object obj)
|
void |
setValue(Object obj,
boolean allowTypeChange)
|
void |
setValue(Object obj,
ODValueType vt,
boolean allowTypeChange,
boolean lenient)
Change the value of this cell. |
void |
unmerge()
|
| Methods inherited from class org.jopendocument.dom.spreadsheet.Cell |
|---|
coversOtherCells, getColumnsSpanned, getDateValue, getDateValue, getDefaultFormulaNS, getError, getFormula, getFormulaAndNamespace, getFormulaNSPrefix, getNS, getRawFormula, getRawValue, getRow, getRowsSpanned, getTextValue, getTextValue, getTextValueMode, getType, getValue, getValueNS, getValueType, isCovered, isEmpty, isValid, setTextValueMode |
| Methods inherited from class org.jopendocument.dom.ImmutableDocStyledNode |
|---|
getContent, getODDocument |
| Methods inherited from class org.jopendocument.dom.StyledNode |
|---|
getPrivateStyle, getStyle, getStyle, getStyle, getStyle, getStyleDesc, getStyleDesc, getStyleDesc, getStyleStyleDesc, setStyleName, setStyleName |
| Methods inherited from class org.jopendocument.dom.ODNode |
|---|
getElement, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static String formatNumber(Number n, CellStyle defaultStyle)
public static String formatPercent(Number n, CellStyle defaultStyle)
public static String formatCurrency(Number n, CellStyle defaultStyle)
public static void setTimeValueMode(boolean loMode)
public static boolean getTimeValueMode()
setValue(Object) formats Duration using the standard way or using
the LibreOffice way. LibreOffice does not support years, months and days in cells ; even set
to 0 (it does in user meta fields). The initial value is true.
true if durations should be formatted the LibO way.public final int getX()
public final int getY()
public final Point getPoint()
public void clearValue()
public void setValue(Object obj)
public void setValue(Object obj, boolean allowTypeChange) throws UnsupportedOperationException
UnsupportedOperationExceptionpublic void setValue(Object obj, ODValueType vt, boolean allowTypeChange, boolean lenient) throws UnsupportedOperationException
obj - the new cell value.vt - the value type.allowTypeChange - if true obj and vt might be
changed to allow the data style to format, e.g. from Boolean.FALSE to 0.lenient - false to throw an exception if we can't format according to the
ODF, true to try best-effort.
UnsupportedOperationException - if obj couldn't be formatted.public final DataStyle getDataStyle()
protected final CellStyle getDefaultStyle()
public void replaceBy(String oldValue, String newValue)
public final void setRawFormula(String formula)
formula - the raw value, e.g. "of:sum(A1:A2)".public final void setFormulaAndNamespace(Tuple2<org.jdom.Namespace,String> formula)
public final void setFormula(String formula)
public final void setFormulaAndNamespace(org.jdom.Namespace ns, String formula)
public final void unmerge()
public final void merge(int columnsSpanned, int rowsSpanned)
columnsSpanned - number of columns to merge.rowsSpanned - number of rows to merge.public final String getStyleName()
getStyleName in class Cell<D extends ODDocument>public final CellStyle.StyleTableCellProperties getTableCellProperties()
public void setImage(File pic) throws IOException
IOExceptionpublic void setImage(File pic, boolean keepRatio) throws IOException
IOExceptionpublic void setImage(String name, Image img) throws IOException
IOExceptionpublic final void setBackgroundColor(Color color)
protected final org.jdom.Namespace getTABLE()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||