public class ButtonCell extends AbstractSafeHtmlCell<String>
Cell
used to render a button.Cell.Context
Constructor and Description |
---|
ButtonCell()
Construct a new ButtonCell that will use a
SimpleSafeHtmlRenderer . |
ButtonCell(SafeHtmlRenderer<String> renderer)
Construct a new ButtonCell that will use a given
SafeHtmlRenderer . |
Modifier and Type | Method and Description |
---|---|
void |
onBrowserEvent(Cell.Context context,
Element parent,
String value,
NativeEvent event,
ValueUpdater<String> valueUpdater)
Handle a browser event that took place within the cell.
|
protected void |
onEnterKeyDown(Cell.Context context,
Element parent,
String value,
NativeEvent event,
ValueUpdater<String> valueUpdater)
Called when the user triggers a
keydown event with the ENTER
key while focused on the cell. |
void |
render(Cell.Context context,
SafeHtml data,
SafeHtmlBuilder sb)
Render the cell contents after they have been converted to
SafeHtml
form. |
getRenderer, render
dependsOnSelection, getConsumedEvents, handlesSelection, isEditing, resetFocus, setValue
public ButtonCell()
SimpleSafeHtmlRenderer
.public ButtonCell(SafeHtmlRenderer<String> renderer)
SafeHtmlRenderer
.renderer
- a SafeHtmlRenderer
instancepublic 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 AbstractCell<String>
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, SafeHtml data, SafeHtmlBuilder sb)
AbstractSafeHtmlCell
SafeHtml
form.render
in class AbstractSafeHtmlCell<String>
context
- the original context to renderdata
- a SafeHtml
stringsb
- the SafeHtmlBuilder
to be written toprotected void onEnterKeyDown(Cell.Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater)
AbstractCell
keydown
event with the ENTER
key while focused on the cell. If your cell interacts with the user, you
should override this method to provide a consistent user experience. Your
widget must consume keydown
events for this method to be
called.onEnterKeyDown
in class AbstractCell<String>
context
- the Context
of the cellparent
- the parent Elementvalue
- the value associated with the cellevent
- the native browser eventvalueUpdater
- a ValueUpdater
, or null if not specifiedCopyright © 2018. All rights reserved.