|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.nocrala.tools.texttablefmt.CellStyle
public class CellStyle
Defines how the content of a cell is rendered.
It allows to specify the text alignment, the abbreviation mode and rendering of null values.
Nested Class Summary | |
---|---|
static class |
CellStyle.AbbreviationStyle
This enumeration is used to specify how to reduce a text to fit it in a small cell. |
static class |
CellStyle.HorizontalAlign
This enumeration is used to specify how a text is horizontally aligned in a cell. |
static class |
CellStyle.NullStyle
This enumeration is used to specify how to display cell with null values. |
Constructor Summary | |
---|---|
CellStyle()
Default style that assumes HorizontalAlign.left, AbbreviationStyle.dots and NullStyle.emptyString. |
|
CellStyle(CellStyle.HorizontalAlign horAlign)
Style with a specified horizontal alignment, that assumes AbbreviationStyle.dots and NullStyle.emptyString. |
|
CellStyle(CellStyle.HorizontalAlign horAlign,
CellStyle.AbbreviationStyle abbStyle)
Style with a specified horizontal alignment and abbreviation style, that assumes NullStyle.emptyString. |
|
CellStyle(CellStyle.HorizontalAlign horAlign,
CellStyle.AbbreviationStyle abbStyle,
CellStyle.NullStyle nullStyle)
Full constructor, that specifies all characteristics. |
Method Summary | |
---|---|
int |
getWidth(java.lang.String txt)
Returns the width of a rendered text, based on the cell content and style. |
java.lang.String |
render(java.lang.String txt,
int width)
Renders a text based on the cell content, style and specified width. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CellStyle()
Default style that assumes HorizontalAlign.left, AbbreviationStyle.dots and NullStyle.emptyString.
public CellStyle(CellStyle.HorizontalAlign horAlign)
Style with a specified horizontal alignment, that assumes AbbreviationStyle.dots and NullStyle.emptyString.
public CellStyle(CellStyle.HorizontalAlign horAlign, CellStyle.AbbreviationStyle abbStyle)
Style with a specified horizontal alignment and abbreviation style, that assumes NullStyle.emptyString.
public CellStyle(CellStyle.HorizontalAlign horAlign, CellStyle.AbbreviationStyle abbStyle, CellStyle.NullStyle nullStyle)
horAlign
- Horizontal alignment.abbStyle
- Abbreviation style.nullStyle
- Null style.Method Detail |
---|
public int getWidth(java.lang.String txt)
txt
- Text to render.
public java.lang.String render(java.lang.String txt, int width)
txt
- Text to render.width
- Fixed width to accommodate the test to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |