T - The class of the bean containing the metadata of the tablepublic class CmsBeanTableBuilder<T> extends java.lang.Object
The columns of the table correspond to getters of the given bean class with the Column annotation.
| Constructor and Description |
|---|
CmsBeanTableBuilder(java.lang.Class<T> cls,
java.lang.String view)
Creates a new table builder instance for the given bean class and view.
|
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.v7.ui.Table |
buildTable(java.util.List<T> beans)
Builds a table and uses the given beans to fill its rows.
|
void |
buildTable(com.vaadin.v7.ui.Table table,
java.util.List<T> beans)
Sets up a table and uses the given beans to fill its rows, but does not actually create the table instance; it uses the passed in table instance instead.
|
com.vaadin.v7.ui.Table.CellStyleGenerator |
getDefaultCellStyleGenerator()
Creates a default cell style generator which just returns the value of the styleName attribute in a Column annotation for cells in that column.
|
com.vaadin.v7.data.Container.Filter |
getDefaultFilter(java.lang.String filterString)
Creates a default filter which just searches the lower case version of the result of the toString() method applied to all columns with the annotation attribute filterable = true.
|
CmsMacroResolver |
getMacroResolver()
Gets the macro resolver which is used for column headers.
|
static boolean |
isProbablyMessageKey(java.lang.String str)
Checks if the given string is likely a message key.
|
static <V> CmsBeanTableBuilder<V> |
newInstance(java.lang.Class<V> cls)
Convenience method used to create a new instance of a table builder.
|
static <V> CmsBeanTableBuilder<V> |
newInstance(java.lang.Class<V> cls,
java.lang.String view)
Convenience method used to create a new instance of a table builder.
|
void |
setMacroResolver(CmsMacroResolver resolver)
Sets the macro resolver.
|
public CmsBeanTableBuilder(java.lang.Class<T> cls, java.lang.String view)
Depending on the view configuration of the columns, columns may be hidden depending on the view.
cls - the bean classview - the selected viewpublic static boolean isProbablyMessageKey(java.lang.String str)
str - the input stringpublic static <V> CmsBeanTableBuilder<V> newInstance(java.lang.Class<V> cls)
cls - the bean classpublic static <V> CmsBeanTableBuilder<V> newInstance(java.lang.Class<V> cls, java.lang.String view)
cls - the bean classview - the selected viewpublic com.vaadin.v7.ui.Table buildTable(java.util.List<T> beans)
beans - the beans to display in the tablepublic void buildTable(com.vaadin.v7.ui.Table table, java.util.List<T> beans)
table - the table to set upbeans - the beans to display in the tablepublic com.vaadin.v7.ui.Table.CellStyleGenerator getDefaultCellStyleGenerator()
public com.vaadin.v7.data.Container.Filter getDefaultFilter(java.lang.String filterString)
filterString - the string for which to filterpublic CmsMacroResolver getMacroResolver()
public void setMacroResolver(CmsMacroResolver resolver)
resolver - the macro resolver