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

PropertyReturnsDescription
classesSet<String>The CSS classes added so far for this column's cells.
idStringIdentifier for the column this builder will produce.
sortablebooleanWhether this column is currently set to be sortable.
titleStringThe title currently set on this builder.
visiblebooleanWhether 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.

ParameterDescription
sthe column title

width(int i)

Returns: ColumnMetaBuilder

Sets the column's width.

ParameterDescription
ithe column width

attr(String name, String value)

Returns: ColumnMetaBuilder

Adds an HTML attribute to render on this column's cells.

ParameterDescription
namethe attribute name
valuethe 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.

ParameterDescription
transcodethe 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.

ParameterDescription
strue 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.

ParameterDescription
visibletrue 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.

ParameterDescription
sthe 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.

ParameterDescription
ssthe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.