public class TextInputCell extends AbstractInputCell<String,TextInputCell.ViewData>
AbstractCell
used to render a text input.Modifier and Type | Class and Description |
---|---|
static class |
TextInputCell.ViewData
The
ViewData for this cell. |
Cell.Context
Constructor and Description |
---|
TextInputCell()
Constructs a TextInputCell that renders its text without HTML markup.
|
TextInputCell(SafeHtmlRenderer<String> renderer)
Deprecated.
the value of a text input is never treated as html
|
Modifier and Type | Method and Description |
---|---|
protected void |
finishEditing(Element parent,
String value,
Object key,
ValueUpdater<String> valueUpdater)
Call this method when editing is complete.
|
protected InputElement |
getInputElement(Element parent)
Get the input element.
|
void |
onBrowserEvent(Cell.Context context,
Element parent,
String value,
NativeEvent event,
ValueUpdater<String> valueUpdater)
Handle a browser event that took place within the cell.
|
void |
render(Cell.Context context,
String value,
SafeHtmlBuilder sb)
Render a cell as HTML into a
SafeHtmlBuilder , suitable for passing
to Element.setInnerHTML(String) on a container element. |
isEditing, onEnterKeyDown, resetFocus
clearViewData, getViewData, setViewData
dependsOnSelection, getConsumedEvents, handlesSelection, setValue
public TextInputCell()
@Deprecated public TextInputCell(SafeHtmlRenderer<String> renderer)
SafeHtmlRenderer
.renderer
- parameter is ignoredpublic void onBrowserEvent(Cell.Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater)
AbstractCell
If you override this method to add support for events, remember to pass the event types that the cell expects into the constructor.
onBrowserEvent
in interface Cell<String>
onBrowserEvent
in class AbstractInputCell<String,TextInputCell.ViewData>
context
- the Cell.Context
of the cellparent
- the parent Elementvalue
- the value associated with the cellevent
- the native browser eventvalueUpdater
- a ValueUpdater
, or null if not specifiedpublic void render(Cell.Context context, String value, 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<String>
render
in class AbstractCell<String>
context
- the Cell.Context
of the cellvalue
- the cell value to be renderedsb
- the SafeHtmlBuilder
to be written toprotected void finishEditing(Element parent, String value, Object key, ValueUpdater<String> valueUpdater)
AbstractInputCell
finishEditing
in class AbstractInputCell<String,TextInputCell.ViewData>
parent
- the parent Elementvalue
- the value associated with the cellkey
- the unique key associated with the row objectvalueUpdater
- the value update to fireprotected InputElement getInputElement(Element parent)
AbstractInputCell
getInputElement
in class AbstractInputCell<String,TextInputCell.ViewData>
parent
- the cell parent elementCopyright © 2018. All rights reserved.