T
- the row data typeW
- the Widget typepublic abstract class WidgetRenderer<T,W extends com.google.gwt.user.client.ui.Widget> extends ComplexRenderer<T>
Constructor and Description |
---|
WidgetRenderer() |
Modifier and Type | Method and Description |
---|---|
abstract W |
createWidget()
Creates a widget to attach to a cell.
|
protected W |
getWidget(com.google.gwt.dom.client.TableCellElement e)
Returns the widget contained inside the given cell element.
|
protected static <W extends com.google.gwt.user.client.ui.Widget> |
getWidget(com.google.gwt.dom.client.TableCellElement e,
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.
|
destroy, destroy, getConsumedEvents, onActivate, onBrowserEvent, setContentVisible
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
FlyweightCell
public abstract W createWidget()
public void render(RendererCellReference cell, T data)
Renderer
Grid
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 objectpublic 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(com.google.gwt.dom.client.TableCellElement e)
e
- the element inside which to find a widgetprotected static <W extends com.google.gwt.user.client.ui.Widget> W getWidget(com.google.gwt.dom.client.TableCellElement e, Class<W> klass)
e
- the element inside to find a widgetklass
- the type of the widget to findCopyright © 2018 Vaadin Ltd. All rights reserved.