Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.jopendocument.dom.spreadsheet
Class MutableCell<D extends ODDocument>

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>
Type Parameters:
D - type of document

public class MutableCell<D extends ODDocument>
extends Cell<D>

A cell whose value can be changed.

Author:
Sylvain

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

formatNumber

public static String formatNumber(Number n,
 CellStyle defaultStyle)

formatPercent

public static String formatPercent(Number n,
 CellStyle defaultStyle)

formatCurrency

public static String formatCurrency(Number n,
 CellStyle defaultStyle)

setTimeValueMode

public static void setTimeValueMode(boolean loMode)

getTimeValueMode

public static boolean getTimeValueMode()
Whether 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.

Returns:
true if durations should be formatted the LibO way.

getX

public final int getX()

getY

public final int getY()

getPoint

public final Point getPoint()

clearValue

public void clearValue()

setValue

public void setValue(Object obj)

setValue

public void setValue(Object obj,
 boolean allowTypeChange)
 throws UnsupportedOperationException
Throws:
UnsupportedOperationException

setValue

public void setValue(Object obj,
 ODValueType vt,
 boolean allowTypeChange,
 boolean lenient)
 throws UnsupportedOperationException
Change the value of this cell.

Parameters:
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.
Throws:
UnsupportedOperationException - if obj couldn't be formatted.

getDataStyle

public final DataStyle getDataStyle()

getDefaultStyle

protected final CellStyle getDefaultStyle()

replaceBy

public void replaceBy(String oldValue,
 String newValue)

setRawFormula

public final void setRawFormula(String formula)
Set the raw value of the formula attribute.

Parameters:
formula - the raw value, e.g. "of:sum(A1:A2)".

setFormulaAndNamespace

public final void setFormulaAndNamespace(Tuple2<org.jdom.Namespace,String> formula)

setFormula

public final void setFormula(String formula)

setFormulaAndNamespace

public final void setFormulaAndNamespace(org.jdom.Namespace ns,
 String formula)

unmerge

public final void unmerge()

merge

public final void merge(int columnsSpanned,
 int rowsSpanned)
Merge this cell and the following ones. If this cell already spanned multiple columns/rows this method un-merge any additional cells.

Parameters:
columnsSpanned - number of columns to merge.
rowsSpanned - number of rows to merge.

getStyleName

public final String getStyleName()
Overrides:
getStyleName in class Cell<D extends ODDocument>

getTableCellProperties

public final CellStyle.StyleTableCellProperties getTableCellProperties()

setImage

public void setImage(File pic)
 throws IOException
Throws:
IOException

setImage

public void setImage(File pic,
 boolean keepRatio)
 throws IOException
Throws:
IOException

setImage

public void setImage(String name,
 Image img)
 throws IOException
Throws:
IOException

setBackgroundColor

public final void setBackgroundColor(Color color)

getTABLE

protected final org.jdom.Namespace getTABLE()

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 jOpenDocument All Rights Reserved.

AltStyle によって変換されたページ (->オリジナル) /