C
- the type that this Cell representspublic abstract class AbstractSafeHtmlCell<C> extends AbstractCell<C>
Cell
s that render or escape a String argument as
HTML.Cell.Context
Constructor and Description |
---|
AbstractSafeHtmlCell(SafeHtmlRenderer<C> renderer,
java.util.Set<java.lang.String> consumedEvents)
Construct an AbstractSafeHtmlCell using a given
SafeHtmlRenderer
that will consume a given set of events. |
AbstractSafeHtmlCell(SafeHtmlRenderer<C> renderer,
java.lang.String... consumedEvents)
Construct an AbstractSafeHtmlCell using a given
SafeHtmlRenderer
that will consume a given set of events. |
Modifier and Type | Method and Description |
---|---|
SafeHtmlRenderer<C> |
getRenderer()
Return the
SafeHtmlRenderer used by this cell. |
void |
render(Cell.Context context,
C data,
SafeHtmlBuilder sb)
Render a cell as HTML into a
SafeHtmlBuilder , suitable for passing
to Element.setInnerHTML(String) on a container element. |
protected abstract void |
render(Cell.Context context,
SafeHtml data,
SafeHtmlBuilder sb)
Render the cell contents after they have been converted to
SafeHtml
form. |
dependsOnSelection, getConsumedEvents, handlesSelection, isEditing, onBrowserEvent, onEnterKeyDown, resetFocus, setValue
public AbstractSafeHtmlCell(SafeHtmlRenderer<C> renderer, java.lang.String... consumedEvents)
SafeHtmlRenderer
that will consume a given set of events.renderer
- a SafeHtmlRendererconsumedEvents
- a varargs list of event namespublic AbstractSafeHtmlCell(SafeHtmlRenderer<C> renderer, java.util.Set<java.lang.String> consumedEvents)
SafeHtmlRenderer
that will consume a given set of events.renderer
- a SafeHtmlRendererconsumedEvents
- a Set of event namespublic SafeHtmlRenderer<C> getRenderer()
SafeHtmlRenderer
used by this cell.SafeHtmlRenderer
instancepublic void render(Cell.Context context, C data, SafeHtmlBuilder sb)
Cell
SafeHtmlBuilder
, suitable for passing
to Element.setInnerHTML(String)
on a container element.
Note: If your cell contains natively focusable elements, such as buttons or input elements, be sure to set the tabIndex to -1 so that they do not steal focus away from the containing widget.
render
in interface Cell<C>
render
in class AbstractCell<C>
context
- the Cell.Context
of the celldata
- the cell value to be renderedsb
- the SafeHtmlBuilder
to be written toprotected abstract void render(Cell.Context context, SafeHtml data, SafeHtmlBuilder sb)
SafeHtml
form.context
- the original context to renderdata
- a SafeHtml
stringsb
- the SafeHtmlBuilder
to be written to