public class AbstractRowRenderer<T> extends Object implements IClickableRowRenderer<T>
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractRowRenderer.IRowRendered<T> |
| Constructor and Description |
|---|
AbstractRowRenderer(Class<T> data) |
AbstractRowRenderer(Class<T> data,
ClassMetaModel cmm) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeQuery(TableModelTableBase<T> tbl)
This gets called by the data table component just before it starts to render
a new page.
|
protected void |
check()
Throws an exception if this renderer has been completed and is unmutable.
|
protected void |
complete(TableModelTableBase<T> tbl)
Complete this object if it is not already complete (internal).
|
protected Class<?> |
getActualClass()
Returns the record type being rendered.
|
ICellClicked<?> |
getCellClicked(int col)
Get the cell clicked handler for the specified column.
|
SimpleColumnDef<?> |
getColumn(int ix)
Return the definition for the nth column.
|
SimpleColumnDef<?> |
getColumnByName(String propertyName)
Find a column by the property it is displaying.
|
int |
getColumnCount()
Return the #of columns in this renderer.
|
protected ColumnDefList<T> |
getColumnList() |
INodeContentRenderer<?> |
getNodeRenderer(int index)
Convenience method to get the column's cell renderer; replacement for getColumn(index).getRenderer().
|
AbstractRowRenderer.IRowRendered<T> |
getOnRowRendered()
Sets a handler that gets called every time a row is rendered.
|
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 SimpleColumnDef<?> |
getSortColumn() |
String |
getUnknownColumnCaption() |
protected boolean |
isComplete()
Check if this object is used (completed) and thereby unmodifyable (internal).
|
protected boolean |
isSortDescending()
The current sorting state of the sort column, as defined by the user's clicking the header.
|
protected ClassMetaModel |
model()
Returns the metamodel used.
|
protected <X> void |
renderColumn(TableModelTableBase<T> tbl,
ColumnContainer<T> cc,
int index,
T instance,
SimpleColumnDef<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(SimpleColumnDef<?> cd,
SortableType type)
Sets default sort column on row renderer.
|
<T> void |
setNodeRenderer(int index,
INodeContentRenderer<T> renderer)
Convenience method to set the column's cell renderer; replacement for getColumn(index).setRenderer().
|
void |
setOnRowRendered(AbstractRowRenderer.IRowRendered<T> onRowRendered) |
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.
|
void |
setSort(String column,
SortableType type) |
protected void |
setSortColumn(SimpleColumnDef<?> cd,
SortableType type) |
void |
setUnknownColumnCaption(String unknownColumnCaption) |
public AbstractRowRenderer(@Nonnull Class<T> data, @Nonnull ClassMetaModel cmm)
@Nonnull protected ColumnDefList<T> getColumnList()
public void setDefaultSort(@Nonnull SimpleColumnDef<?> cd, @Nonnull SortableType type)
cd - type - public void setSort(@Nonnull String column, @Nonnull SortableType type)
@Nonnull protected ClassMetaModel model()
@Nonnull protected Class<?> getActualClass()
protected void check()
@OverridingMethodsMustInvokeSuper protected void complete(@Nonnull TableModelTableBase<T> tbl)
protected boolean isComplete()
protected void setSortColumn(@Nullable SimpleColumnDef<?> cd, @Nullable SortableType type)
@Nullable protected SimpleColumnDef<?> getSortColumn()
protected boolean isSortDescending()
@Nonnull public SimpleColumnDef<?> getColumn(int ix)
ix - public int getColumnCount()
@Nonnull public SimpleColumnDef<?> getColumnByName(String propertyName)
propertyName - public void setColumnWidths(String... widths)
widths - public void setColumnWidth(int index,
String width)
index - width - public <T> void setNodeRenderer(int index,
@Nullable
INodeContentRenderer<T> 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 - 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 SimpleColumnDef<X> cd) throws Exception
tbl - cc - index - instance - cd - Exception@Nullable public IRowButtonFactory<T> getRowButtonFactory()
public void setRowButtonFactory(@Nullable IRowButtonFactory<T> rowButtonFactory)
@Nullable public AbstractRowRenderer.IRowRendered<T> getOnRowRendered()
public void setOnRowRendered(@Nullable AbstractRowRenderer.IRowRendered<T> onRowRendered)
Copyright © 2017 etc.to. All rights reserved.