|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.odftoolkit.simple.table.CellStyleHandler
public class CellStyleHandler
This class provides functions to handle the style of a cell.
This class provides functions to handle the border settings, font settings, text alignment settings and so on.
| Method Summary | |
|---|---|
Color |
getBackgroundColor()
Return the background color. |
Border |
getBorder(StyleTypeDefinitions.CellBordersType type)
Return the border setting for a specific border. |
protected OdfStyleBase |
getCellStyleElementForRead()
Return the style element for this cell, only for read function. |
protected OdfStyle |
getCellStyleElementForWrite()
Return the style element for this cell, for read and write functions. |
String |
getCountry(Document.ScriptType type)
Return the country information for a specific script type |
Font |
getFont(Document.ScriptType type)
Return the font definition for a specific script type. |
StyleTypeDefinitions.HorizontalAlignmentType |
getHorizontalAlignment()
Return the horizontal alignment. |
String |
getLanguage(Document.ScriptType type)
Return the language information for a specific script type |
ParagraphProperties |
getParagraphPropertiesForRead()
Return the paragraph style properties definition for this cell, only for read function. |
ParagraphProperties |
getParagraphPropertiesForWrite()
Return the paragraph style properties definition for this cell, for read and write function. |
TableCellProperties |
getTableCellPropertiesForRead()
Return the cell style properties definition for this cell, only for read function. |
TableCellProperties |
getTableCellPropertiesForWrite()
Return the cell style properties definition for this cell, for read and write function. |
TextProperties |
getTextPropertiesForRead()
Return the text style properties definition for this cell, only for read function. |
TextProperties |
getTextPropertiesForWrite()
Return the text style properties definition for this cell, for read and write function. |
StyleTypeDefinitions.VerticalAlignmentType |
getVerticalAlignment()
Return the vertical alignment. |
boolean |
isTextWrapped()
Return the wrap option of this cell. |
void |
setBackgroundColor(Color color)
Set the background color of this cell. |
void |
setBorders(Border border,
StyleTypeDefinitions.CellBordersType bordersType)
Set the border style of this cell. |
void |
setCountry(String country,
Document.ScriptType type)
Set the country information for a specific script type |
void |
setFont(Font font)
Set the font definition. |
void |
setFont(Font font,
Locale language)
Set the font definition. |
void |
setHorizontalAlignment(StyleTypeDefinitions.HorizontalAlignmentType alignType)
Set the horizontal alignment. |
void |
setLanguage(String language,
Document.ScriptType type)
Set the language information for a specific script type |
void |
setTextWrapped(boolean isWrapped)
Set the wrap option of this cell. |
void |
setVerticalAlignment(StyleTypeDefinitions.VerticalAlignmentType alignType)
Set the vertical alignment setting of this cell. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public TextProperties getTextPropertiesForRead()
Null will be returned if there is no style definition.
Null will be returned if there is no explicit text style properties definition for this cell.
Note if you try to write style properties to the returned object, errors will be met with.
public TextProperties getTextPropertiesForWrite()
An empty style definition will be created if there is no style definition.
An empty text style properties definition will be created if there is no explicit text style properties definition.
public TableCellProperties getTableCellPropertiesForRead()
Null will be returned if there is no style definition.
Null will be returned if there is no explicit cell style properties definition for this cell.
Note if you try to write style properties to the returned object, errors will be met with.
public TableCellProperties getTableCellPropertiesForWrite()
An empty style definition will be created if there is no style definition.
An empty cell style properties definition will be created if there is no explicit cell style properties definition.
public ParagraphProperties getParagraphPropertiesForRead()
Null will be returned if there is no style definition.
Null will be returned if there is no explicit paragraph style properties definition for this cell.
Note if you try to write style properties to the returned object, errors will be met with.
public ParagraphProperties getParagraphPropertiesForWrite()
An empty style definition will be created if there is no style definition.
An empty paragraph style properties definition will be created if there is no explicit paragraph style properties definition.
protected OdfStyleBase getCellStyleElementForRead()
Null will be returned if there is no style definition.
Note if you try to write style properties to the returned object, errors will be met with.
protected OdfStyle getCellStyleElementForWrite()
An empty style definition will be created if there is no style definition.
public String getCountry(Document.ScriptType type)
The country information in its parent style and default style will be taken into considered.
Null will be returned if there is no country information for this script type.
type - - script type
public Font getFont(Document.ScriptType type)
The font definition in its parent style and default style will be taken into considered.
A default font definition will be returned if there is no font definition for this script type at all.
type - - script type
public String getLanguage(Document.ScriptType type)
The language definition in its parent style and default style will be taken into considered.
Null will be returned if there is no language information for this script type at all.
type - - script type
public void setCountry(String country,
Document.ScriptType type)
The consistency between country and script type is not verified.
If the parameter country is null, the country information
for this script type will be removed.
country - - the country informationtype - - script typeTextProperties.setCountry(String, Document.ScriptType),
Document.ScriptTypepublic void setFont(Font font)
If the parameter font is null, nothing will be happened.
font - - font definition
public void setFont(Font font,
Locale language)
If the parameter font is null, nothing will be happened.
font - - font definition
public void setLanguage(String language,
Document.ScriptType type)
If the parameter language is null, the language information
for this script type will be removed.
language - - the language informationtype - - script typepublic Color getBackgroundColor()
The background color in its parent style and default style will be taken into considered.
Color WHITE will be returned if there is no the background color definition or the background color definition is not valid.
public Border getBorder(StyleTypeDefinitions.CellBordersType type)
The accepted parameter can be TOP,BOTTOM,LEFT,RIGHT,DIAGONALBLTR and DIAGONALTLBR.
The border type with a collection of borders, e.g. ALL_FOUR, LEFT_RIGHT, are not legal arguments
The border definition in its parent style and default style will be taken into considered.
Border.NONE will be returned if there is no the border
definition for a specific border.
type - - the border type which describes a single border
public StyleTypeDefinitions.VerticalAlignmentType getVerticalAlignment()
If there is no vertical alignment definition, DEFAULT will be returned.
The vertical alignment definition in its parent style and default style will be taken into considered.
public boolean isTextWrapped()
The wrap option definition in its parent style and default style will be taken into considered.
true if the cell content can be wrapped;
false if the cell content cannot be wrapped.
public void setBackgroundColor(Color color)
color - - the background color that need to set. If color
is null, background color setting will be removed.
public void setBorders(Border border,
StyleTypeDefinitions.CellBordersType bordersType)
The second parameter bordersType describes which borders you
want to apply the style to, e.g. up border, bottom border, left border,
right border, diagonal lines or four borders.
border - - the border style descriptionbordersType - - the type of the borderspublic void setVerticalAlignment(StyleTypeDefinitions.VerticalAlignmentType alignType)
If the alignment is set as Default or null, the explicit vertical alignment setting is removed.
alignType - - the vertical alignment setting.public void setTextWrapped(boolean isWrapped)
isWrapped - - whether the cell content can be wrapped or notpublic void setHorizontalAlignment(StyleTypeDefinitions.HorizontalAlignmentType alignType)
If the parameter alignType is null, the horizontal alignment
setting will be removed.
alignType - - the horizontal alignmentpublic StyleTypeDefinitions.HorizontalAlignmentType getHorizontalAlignment()
The horizontal alignment in its parent style and default style will be taken into considered.
DEFAULT will be returned if there is no horizontal alignment setting.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||