public static class TablePrinter.PrintConfig extends Object
Note: Alas ! TablePrinter does not support cellspans across columns or rows. That would make things too complicated for this implementation.
Constructor and Description |
---|
PrintConfig()
Constructs a new PrintConfig with the following default options.
|
Modifier and Type | Method and Description |
---|---|
String[] |
getHeader()
Gets the header row for the table if set.
|
TablePrinter.PrintConfig |
headerEveryPage(boolean show)
Specifies that page heading (if set) on each separate
page.
|
TablePrinter.PrintConfig |
setAlign(HAlign align)
Sets the alignment of each cell.
|
TablePrinter.PrintConfig |
setAutoFit(boolean autofit)
Sets each cell to expand to the size needed for the maximum
sized cell in that column.
|
TablePrinter.PrintConfig |
setCellBorderHorizontal(String str)
Sets the string (typically a single character) that makes up a
horizontal cell border.
|
TablePrinter.PrintConfig |
setCellBorderVertical(String str)
Sets the string (typically a single character) that makes up a
vertical cell border.
|
TablePrinter.PrintConfig |
setCellCorner(String str)
Sets the string (typically a single character) that makes up a
cell corner.
|
TablePrinter.PrintConfig |
setCellPadding(int width)
Specifies the cell padding for each cell.
|
TablePrinter.PrintConfig |
setCellPaddingGlyph(String str)
Sets the string (typically a single character) that makes up
the cellpadding.
|
TablePrinter.PrintConfig |
setCellSpacing(int width)
Specifies the cell spacing between cells.
|
TablePrinter.PrintConfig |
setCellSpacingGlyph(String str)
Sets the string (typically a single character) that makes up
the cellspacing.
|
TablePrinter.PrintConfig |
setCellWidth(int width)
Sets the width of each cell.
|
TablePrinter.PrintConfig |
setCellWidthForColumn(int column,
int width)
Sets the cell width of the the specified column.
|
TablePrinter.PrintConfig |
setCellWrap(boolean wrap)
Cell wrapping is on by default and the contents of any column that
exceed the width are wrapped within each cell (using the current platforms line
seperator for newlines within the cell).
|
void |
setHeader(String[] header)
Optionally sets the header row for the table
|
TablePrinter.PrintConfig |
setPageSize(int lines)
Sets the number of lines on each page.
|
TablePrinter.PrintConfig |
setPrintBorders(boolean print)
Specifies whether table and cell borders are printed.
|
String |
toString()
Prints a short description of this object.
|
public PrintConfig()
HAlign.LEFT
public String[] getHeader()
public TablePrinter.PrintConfig setPageSize(int lines)
showPageHeading()
lines
- number of lines on the page, specify a zero or
negative quantity for a single page. (number of
lines not including lines occupied by the table
header itself, if the header is printed).public TablePrinter.PrintConfig headerEveryPage(boolean show)
setPageSize
method is
invoked.public TablePrinter.PrintConfig setAlign(HAlign align)
left
public TablePrinter.PrintConfig setCellCorner(String str)
public TablePrinter.PrintConfig setCellBorderHorizontal(String str)
public TablePrinter.PrintConfig setCellBorderVertical(String str)
public TablePrinter.PrintConfig setCellPaddingGlyph(String str)
public TablePrinter.PrintConfig setCellSpacingGlyph(String str)
public TablePrinter.PrintConfig setCellWidth(int width)
width
- the width of each cellpublic TablePrinter.PrintConfig setCellWidthForColumn(int column, int width)
column
- the cell numberwidth
- the desired character widthpublic TablePrinter.PrintConfig setCellWrap(boolean wrap)
wrap
- true To turn cell wrapping on, false
to turn cell wrapping off and show
fixed width contents only.public TablePrinter.PrintConfig setAutoFit(boolean autofit)
Note: using autofit may result in slower performance because the table almost always has to be rendered in two passes.
autofit
- true to turn autofit on,
false otherwise.public TablePrinter.PrintConfig setPrintBorders(boolean print)
print
- true to print borders, false otherwisepublic TablePrinter.PrintConfig setCellSpacing(int width)
public TablePrinter.PrintConfig setCellPadding(int width)