to.etc.domui.component.tbl
Class KeyWordPopupRowRenderer<T>

java.lang.Object
  extended by to.etc.domui.component.tbl.KeyWordPopupRowRenderer<T>
All Implemented Interfaces:
IRowRenderer<T>

public class KeyWordPopupRowRenderer<T>
extends java.lang.Object
implements IRowRenderer<T>

This is simplified row renderer that is used ad default render for popup results in keyword search.

Author:
Vladimir Mijic Created on 27 Jan 2010

Field Summary
protected  java.util.List<SimpleColumnDef> m_columnList
           
 
Constructor Summary
KeyWordPopupRowRenderer(java.lang.Class<T> dataClass, ClassMetaModel cmm, java.lang.String... cols)
          Create a renderer by handling the specified class and a list of properties off it.
 
Method Summary
protected  void addColumns(java.util.List<ExpandedDisplayProperty<?>> xdpl)
           
 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  java.lang.Class<?> getActualClass()
          Returns the record type being rendered.
 SimpleColumnDef getColumn(int ix)
          Return the definition for the nth column.
 SimpleColumnDef getColumnByName(java.lang.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().
 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  boolean isComplete()
          Check if this object is used (completed) and thereby unmodifyable (internal).
protected  ClassMetaModel model()
          Returns the metamodel used.
protected
<X> void
renderColumn(TableModelTableBase<T> tbl, ColumnContainer<T> cc, int index, T instance, SimpleColumnDef cd)
          Render a single column fully.
 void renderHeader(TableModelTableBase<T> tbl, HeaderContainer<T> cc)
          Render table header.
 void renderRow(TableModelTableBase<T> tbl, ColumnContainer<T> cc, int index, T instance)
           
 void setNodeRenderer(int index, INodeContentRenderer<?> renderer)
          Convenience method to set the column's cell renderer; replacement for getColumn(index).setRenderer().
 void setRowClicked(ICellClicked<?> rowClicked)
          When set each row will be selectable (will react when the mouse hovers over it), and when clicked will call this handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_columnList

protected final java.util.List<SimpleColumnDef> m_columnList
Constructor Detail

KeyWordPopupRowRenderer

public KeyWordPopupRowRenderer(@Nonnull
                               java.lang.Class<T> dataClass,
                               @Nonnull
                               ClassMetaModel cmm,
                               java.lang.String... cols)
Create a renderer by handling the specified class and a list of properties off it.

Parameters:
dataClass -
cols -
Method Detail

model

protected ClassMetaModel model()
Returns the metamodel used.

Returns:

getActualClass

protected java.lang.Class<?> getActualClass()
Returns the record type being rendered.

Returns:

check

protected void check()
Throws an exception if this renderer has been completed and is unmutable.


complete

protected void complete(TableModelTableBase<T> tbl)
Complete this object if it is not already complete (internal).


isComplete

protected boolean isComplete()
Check if this object is used (completed) and thereby unmodifyable (internal).

Returns:

getColumn

public SimpleColumnDef getColumn(int ix)
Return the definition for the nth column. You can change the column's definition there.

Parameters:
ix -
Returns:

getColumnCount

public int getColumnCount()
Return the #of columns in this renderer.

Returns:

getColumnByName

public SimpleColumnDef getColumnByName(java.lang.String propertyName)
Find a column by the property it is displaying. This only works for that kind of columns, and will not work for any joined columns defined from metadata. If no column exists for the specified property this will throw an exception.

Parameters:
propertyName -
Returns:

setNodeRenderer

public void setNodeRenderer(int index,
                            INodeContentRenderer<?> renderer)
Convenience method to set the column's cell renderer; replacement for getColumn(index).setRenderer().

Parameters:
index -
renderer -

getNodeRenderer

public INodeContentRenderer<?> getNodeRenderer(int index)
Convenience method to get the column's cell renderer; replacement for getColumn(index).getRenderer().

Parameters:
index -
Returns:

getRowClicked

public ICellClicked<?> getRowClicked()
When set each row will be selectable (will react when the mouse hovers over it), and when clicked will call this handler.

Returns:

setRowClicked

public void setRowClicked(ICellClicked<?> rowClicked)
When set each row will be selectable (will react when the mouse hovers over it), and when clicked will call this handler.

Parameters:
rowClicked -

beforeQuery

public void beforeQuery(TableModelTableBase<T> tbl)
                 throws java.lang.Exception
This gets called by the data table component just before it starts to render a new page. When called the query has not yet been done and nothing is rendered for this object. This exposes the actual model that will be used during the rendering process and allows this component to define sorting, if needed.

Specified by:
beforeQuery in interface IRowRenderer<T>
Throws:
java.lang.Exception
See Also:
to.etc.domui.component.tbl.IRowRenderer#beforeQuery(to.etc.domui.component.tbl.DataTable)

renderRow

public void renderRow(TableModelTableBase<T> tbl,
                      ColumnContainer<T> cc,
                      int index,
                      T instance)
               throws java.lang.Exception
Specified by:
renderRow in interface IRowRenderer<T>
Throws:
java.lang.Exception
See Also:
to.etc.domui.component.tbl.IRowRenderer#renderRow(to.etc.domui.component.tbl.ColumnContainer, int, java.lang.Object)

renderColumn

protected <X> void renderColumn(TableModelTableBase<T> tbl,
                                ColumnContainer<T> cc,
                                int index,
                                T instance,
                                SimpleColumnDef cd)
                     throws java.lang.Exception
Render a single column fully.

Parameters:
tbl -
cc -
index -
instance -
cd -
Throws:
java.lang.Exception

renderHeader

public void renderHeader(TableModelTableBase<T> tbl,
                         HeaderContainer<T> cc)
                  throws java.lang.Exception
Description copied from interface: IRowRenderer
Render table header.

Specified by:
renderHeader in interface IRowRenderer<T>
Throws:
java.lang.Exception

addColumns

protected void addColumns(java.util.List<ExpandedDisplayProperty<?>> xdpl)