Used to render text based table for UI purpose. Example:
def table = new TableBuilder().head('col1').head('col2').head('col3', 10)
table << x << y << z << table.closeRow()
table << p << q << w << table.closeRow()
:
println table.toString()
| Type | Name and description |
|---|---|
java.util.List<java.util.List<TextLabel>> |
allRowsAll the rows |
java.lang.String |
cellSeparator |
java.util.List<TextLabel.Align> |
colsAlign |
java.util.List<TextLabel> |
currentRow |
java.util.List<java.lang.Integer> |
dim |
java.util.List<TextLabel> |
headersThe list defining the table header |
java.util.List<java.lang.Integer> |
maxColsWidth |
java.lang.String |
rowSeparator |
| Type Params | Return Type | Name and description |
|---|---|---|
|
TableBuilder |
append(java.lang.Object... values) |
|
TableBuilder |
append(java.util.List values)Append the specified list of values as the next row in the table, the columns width are adapted accordingly |
|
TableBuilder |
closeRow()Close a row in the @return |
|
TableBuilder |
head(java.lang.String name, int maxWidth = 0 )Defines a single column header, for example:
def table = new TableBuilder().head('col1').head('col2').head('col3', 10)
table << x << y << z
|
|
TableBuilder |
head(java.lang.String name, Align align) |
|
TableBuilder |
leftShift(java.lang.Object value)Defines the left-shift operator useful to build the table using the following syntax
def table = new TableBuilder()
table << col1 << col2 << col3 << table.closeRow()
:
|
|
TableBuilder |
setHeaders(java.lang.String... cols)Use the specific string array as the table header definition |
|
TableBuilder |
setHeaders(TextLabel... cols) |
|
TableBuilder |
setMaxColsWidth(int... colsWidth) |
|
java.lang.String |
toString()@return Render the final table and return the string |
|
protected void |
trackWidths(java.util.List<java.lang.Integer> newDim) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
All the rows
The list defining the table header
Append the specified list of values as the next row in the table, the columns width are adapted accordingly
Close a row in the
Defines a single column header, for example:
def table = new TableBuilder().head('col1').head('col2').head('col3', 10)
table << x << y << z
name - The string value to be used as column headermaxWidth - The column max widthDefines the left-shift operator useful to build the table using the following syntax
def table = new TableBuilder()
table << col1 << col2 << col3 << table.closeRow()
:
value - The value to be added in the table at the current rowUse the specific string array as the table header definition