|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.client.renderers.ComplexRenderer<T>
com.vaadin.client.renderers.WidgetRenderer<T,W>
T - the row data typeW - the Widget typepublic abstract class WidgetRenderer<T,W extends Widget>
A renderer for rendering widgets into cells.
| Constructor Summary | |
|---|---|
WidgetRenderer()
|
|
| Method Summary | ||
|---|---|---|
abstract W |
createWidget()
Creates a widget to attach to a cell. |
|
protected W |
getWidget(TableCellElement e)
Returns the widget contained inside the given cell element. |
|
protected static
|
getWidget(TableCellElement e,
java.lang.Class<W> klass)
Returns the widget contained inside the given cell element, or null if it is not an instance of the given class. |
|
void |
init(RendererCellReference cell)
Called at initialization stage. |
|
void |
render(RendererCellReference cell,
T data)
Called whenever the Grid updates a cell. |
|
abstract void |
render(RendererCellReference cell,
T data,
W widget)
Renders a cell with a widget. |
|
| Methods inherited from class com.vaadin.client.renderers.ComplexRenderer |
|---|
destroy, destroy, getConsumedEvents, onActivate, onBrowserEvent, setContentVisible |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WidgetRenderer()
| Method Detail |
|---|
public void init(RendererCellReference cell)
ComplexRenderer
init in class ComplexRenderer<T>cell - The cell. Note that the cell is not to be stored outside of
the method as the cell instance will change. See
FlyweightCellpublic abstract W createWidget()
public void render(RendererCellReference cell,
T data)
RendererGrid updates a cell.
For optimal performance, work done in this method should be kept to a
minimum since it will be called continuously while the user is scrolling.
It is recommended to set up the cell's DOM structure in
ComplexRenderer.init(RendererCellReference) and only make
incremental updates based on cell data in this method.
cell - The cell. Note that the cell is a flyweight and should not be
stored outside of the method as it will change.data - The column data object
public abstract void render(RendererCellReference cell,
T data,
W widget)
For optimal performance, work done in this method should be kept to a
minimum since it will be called continuously while the user is scrolling.
The renderer can use Widget#setLayoutData(Object) to store cell
data that might be needed in e.g. event listeners.
cell - The cell to render. Note that the cell is a flyweight and
should not be stored and used outside of this method as its
contents will change.data - the data of the cellwidget - the widget embedded in the cellprotected W getWidget(TableCellElement e)
e - the element inside which to find a widget
protected static <W extends Widget> W getWidget(TableCellElement e,
java.lang.Class<W> klass)
e - the element inside to find a widgetklass - the type of the widget to find
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||