public final class MultiRowRenderer<T> extends Object implements IClickableRowRenderer<T>
| Constructor and Description |
|---|
MultiRowRenderer(Class<T> data) |
MultiRowRenderer(Class<T> data,
ClassMetaModel cmm) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultColumns()
Add all of the columns as defined by the metadata to the list.
|
void |
addHeaderAfter(TableHeader header) |
void |
addHeaderBefore(TableHeader header) |
void |
beforeQuery(TableModelTableBase<T> tbl)
This gets called by the data table component just before it starts to render
a new page.
|
ColumnDef<T,T> |
column()
Add a column which gets referred the row element instead of a column element.
|
<V> ColumnDef<T,V> |
column(Class<V> type,
String property)
Add and return the column definition for a column on the specified property.
|
ColumnDef<T,?> |
column(String property)
This adds a column on the specified property, but has no idea about the real type.
|
protected Class<?> |
getActualClass()
Returns the record type being rendered.
|
ICellClicked<?> |
getCellClicked(int col)
Get the cell clicked handler for the specified column.
|
ColumnDef<T,?> |
getColumn(int ix)
Return the definition for the nth column.
|
ColumnDef<T,?> |
getColumnByName(String propertyName)
Find a column by the property it is displaying.
|
int |
getColumnCount()
Return the #of columns in this renderer.
|
INodeContentRenderer<?> |
getNodeRenderer(int index)
Convenience method to get the column's cell renderer; replacement for getColumn(index).getRenderer().
|
IRowButtonFactory<T> |
getRowButtonFactory() |
ICellClicked<?> |
getRowClicked()
When set each row will be selectable (will react when the mouse hovers over it), and when clicked will call this handler.
|
protected ColumnDef<T,?> |
getSortColumn() |
MultiRowRenderer<T> |
helper(IRowRenderHelper<T> helper) |
protected boolean |
isComplete()
Check if this object is used (completed) and thereby unmodifyable (internal).
|
protected boolean |
isSortDescending() |
protected ClassMetaModel |
model()
Returns the metamodel used.
|
protected <X> void |
renderColumn(TableModelTableBase<T> tbl,
ColumnContainer<T> cc,
int index,
T instance,
ColumnDef<T,X> cd)
Render a single column fully.
|
void |
renderHeader(TableModelTableBase<T> tbl,
HeaderContainer<T> cc)
Render the header for a table, using the simple column metadata provided.
|
void |
renderRow(TableModelTableBase<T> tbl,
ColumnContainer<T> cc,
int index,
T instance) |
<V> void |
setCellClicked(int col,
ICellClicked<V> cellClicked)
Set the cell clicked handler for the specified column.
|
void |
setColumnWidth(int index,
String width)
Convenience method to set the column width; replacement for getColumn(index).setWidth().
|
void |
setColumnWidths(String... widths)
Quickly set the widths of all columns in the same order as defined.
|
void |
setDefaultSort(ColumnDef<T,?> cd,
SortableType type)
Sets default sort column on row renderer.
|
<C> void |
setNodeRenderer(int index,
INodeContentRenderer<C> renderer)
Convenience method to set the column's cell renderer; replacement for getColumn(index).setRenderer().
|
void |
setRowButtonFactory(IRowButtonFactory<T> rowButtonFactory) |
<V> void |
setRowClicked(ICellClicked<V> rowClicked)
When set each row will be selectable (will react when the mouse hovers over it), and when clicked will call this handler.
|
protected void |
setSortColumn(ColumnDef<T,?> cd,
SortableType type) |
protected void |
setSortDescending(boolean desc) |
public MultiRowRenderer(@Nonnull Class<T> data, @Nonnull ClassMetaModel cmm)
public MultiRowRenderer<T> helper(IRowRenderHelper<T> helper)
public void renderHeader(@Nonnull TableModelTableBase<T> tbl, @Nonnull HeaderContainer<T> cc) throws Exception
renderHeader in interface IRowRenderer<T>Exceptionpublic void beforeQuery(@Nonnull TableModelTableBase<T> tbl) throws Exception
beforeQuery in interface IRowRenderer<T>Exceptionpublic void renderRow(@Nonnull TableModelTableBase<T> tbl, @Nonnull ColumnContainer<T> cc, int index, @Nonnull T instance) throws Exception
renderRow in interface IRowRenderer<T>Exceptionprotected <X> void renderColumn(@Nonnull TableModelTableBase<T> tbl, @Nonnull ColumnContainer<T> cc, int index, @Nonnull T instance, @Nonnull ColumnDef<T,X> cd) throws Exception
tbl - cc - index - instance - cd - Exception@Nullable public IRowButtonFactory<T> getRowButtonFactory()
public void setRowButtonFactory(@Nullable IRowButtonFactory<T> rowButtonFactory)
public void addDefaultColumns()
public void setDefaultSort(@Nonnull ColumnDef<T,?> cd, @Nonnull SortableType type)
cd - type - @Nonnull protected ClassMetaModel model()
@Nonnull protected Class<?> getActualClass()
protected boolean isComplete()
protected void setSortColumn(@Nullable ColumnDef<T,?> cd, @Nullable SortableType type)
protected boolean isSortDescending()
protected void setSortDescending(boolean desc)
@Nonnull public ColumnDef<T,?> getColumn(int ix)
ix - public int getColumnCount()
@Nonnull public ColumnDef<T,?> getColumnByName(String propertyName)
propertyName - public void setColumnWidths(String... widths)
widths - public void setColumnWidth(int index,
String width)
index - width - public <C> void setNodeRenderer(int index,
@Nullable
INodeContentRenderer<C> renderer)
index - renderer - public INodeContentRenderer<?> getNodeRenderer(int index)
index - @Nullable public ICellClicked<?> getRowClicked()
getRowClicked in interface IRowRenderer<T>public <V> void setRowClicked(@Nullable ICellClicked<V> rowClicked)
setRowClicked in interface IClickableRowRenderer<T>rowClicked - @Nullable public ICellClicked<?> getCellClicked(int col)
col - public <V> void setCellClicked(int col,
@Nullable
ICellClicked<V> cellClicked)
setCellClicked in interface IClickableRowRenderer<T>col - cellClicked - @Nonnull public <V> ColumnDef<T,V> column(@Nonnull Class<V> type, @Nonnull String property)
column(String).type - property - @Nonnull public ColumnDef<T,?> column(@Nonnull String property)
property - @Nonnull public ColumnDef<T,T> column()
public void addHeaderBefore(@Nonnull TableHeader header)
public void addHeaderAfter(@Nonnull TableHeader header)
Copyright © 2017 etc.to. All rights reserved.