Fluent builder for a single ColumnMeta, used to set a column's title, width, sort and visibility, and CSS classes or attributes before it is built as part of a TableViewMetaBuilder.
Group: Builders
Properties
| Property | Returns | Description |
|---|---|---|
| classes | Set<String> | The CSS classes added so far for this column's cells. |
| id | String | Identifier for the column this builder will produce. |
| sortable | boolean | Whether this column is currently set to be sortable. |
| title | String | The title currently set on this builder. |
| visible | boolean | Whether this column will be included when the table is built. |
Methods
title(String s) · width(int i) · attr(String name, String value) · transcode(String transcode) · sortable(boolean s) · visible(boolean visible) · addClass(String s) · addClasses(String ss) · numeric() · getId() · getTitle() · isSortable() · isVisible() · getClasses() · build()
title(String s)
Returns: ColumnMetaBuilder
Sets the column's heading text.
| Parameter | Description |
|---|---|
s | the column title |
width(int i)
Returns: ColumnMetaBuilder
Sets the column's width.
| Parameter | Description |
|---|---|
i | the column width |
attr(String name, String value)
Returns: ColumnMetaBuilder
Adds an HTML attribute to render on this column's cells.
| Parameter | Description |
|---|---|
name | the attribute name |
value | the attribute value |
transcode(String transcode)
Returns: ColumnMetaBuilder
Marks the column for client-side translation lookup: adds the "trans-lookup" CSS class and a data-transcode attribute with the given key, which the client-side transcode script uses to replace the cell content with the translated value for the current locale.
| Parameter | Description |
|---|---|
transcode | the transcode key used to look up the translated value |
sortable(boolean s)
Returns: ColumnMetaBuilder
Sets whether this column supports sorting the table by its values.
| Parameter | Description |
|---|---|
s | true to make the column sortable |
visible(boolean visible)
Returns: ColumnMetaBuilder
Sets whether this column is included when the table is built. A column not marked visible is dropped by TableViewMetaBuilder.build rather than being rendered.
| Parameter | Description |
|---|---|
visible | true to include the column, false to omit it from the built table |
addClass(String s)
Returns: ColumnMetaBuilder
Adds a single CSS class to render on this column's cells. A blank class name is ignored.
| Parameter | Description |
|---|---|
s | the CSS class name to add |
addClasses(String ss)
Returns: ColumnMetaBuilder
Adds one or more CSS classes to render on this column's cells. A null or empty array is ignored.
| Parameter | Description |
|---|---|
ss | the CSS class names to add |
numeric()
Returns: ColumnMetaBuilder
Marks the column as numeric by adding the "text-right" CSS class, so its cell values are right-aligned.
getId()
Returns: String
Identifier for the column this builder will produce.
getTitle()
Returns: String
The title currently set on this builder.
isSortable()
Returns: boolean
Whether this column is currently set to be sortable.
isVisible()
Returns: boolean
Whether this column will be included when the table is built.
getClasses()
Returns: Set<String>
The CSS classes added so far for this column's cells.
build()
Returns: ColumnMeta
Builds the immutable ColumnMeta from this builder's current state, unless the column has been marked not visible.