Package com.google.gwt.cell.client
Class ButtonCell
- java.lang.Object
-
- com.google.gwt.cell.client.AbstractCell<C>
-
- com.google.gwt.cell.client.AbstractSafeHtmlCell<java.lang.String>
-
- com.google.gwt.cell.client.ButtonCell
-
- All Implemented Interfaces:
Cell<java.lang.String>
public class ButtonCell extends AbstractSafeHtmlCell<java.lang.String>
ACell
used to render a button.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.gwt.cell.client.Cell
Cell.Context
-
-
Constructor Summary
Constructors Constructor Description ButtonCell()
Construct a new ButtonCell that will use aSimpleSafeHtmlRenderer
.ButtonCell(SafeHtmlRenderer<java.lang.String> renderer)
Construct a new ButtonCell that will use a givenSafeHtmlRenderer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onBrowserEvent(Cell.Context context, Element parent, java.lang.String value, NativeEvent event, ValueUpdater<java.lang.String> valueUpdater)
Handle a browser event that took place within the cell.protected void
onEnterKeyDown(Cell.Context context, Element parent, java.lang.String value, NativeEvent event, ValueUpdater<java.lang.String> valueUpdater)
Called when the user triggers akeydown
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 toSafeHtml
form.-
Methods inherited from class com.google.gwt.cell.client.AbstractSafeHtmlCell
getRenderer, render
-
Methods inherited from class com.google.gwt.cell.client.AbstractCell
dependsOnSelection, getConsumedEvents, handlesSelection, isEditing, resetFocus, setValue
-
-
-
-
Constructor Detail
-
ButtonCell
public ButtonCell()
Construct a new ButtonCell that will use aSimpleSafeHtmlRenderer
.
-
ButtonCell
public ButtonCell(SafeHtmlRenderer<java.lang.String> renderer)
Construct a new ButtonCell that will use a givenSafeHtmlRenderer
.- Parameters:
renderer
- aSafeHtmlRenderer
instance
-
-
Method Detail
-
onBrowserEvent
public void onBrowserEvent(Cell.Context context, Element parent, java.lang.String value, NativeEvent event, ValueUpdater<java.lang.String> valueUpdater)
Description copied from class:AbstractCell
Handle a browser event that took place within the cell. The default implementation returns null.If you override this method to add support for events, remember to pass the event types that the cell expects into the constructor.
- Specified by:
onBrowserEvent
in interfaceCell<java.lang.String>
- Overrides:
onBrowserEvent
in classAbstractCell<java.lang.String>
- Parameters:
context
- theCell.Context
of the cellparent
- the parent Elementvalue
- the value associated with the cellevent
- the native browser eventvalueUpdater
- aValueUpdater
, or null if not specified
-
render
public void render(Cell.Context context, SafeHtml data, SafeHtmlBuilder sb)
Description copied from class:AbstractSafeHtmlCell
Render the cell contents after they have been converted toSafeHtml
form.- Specified by:
render
in classAbstractSafeHtmlCell<java.lang.String>
- Parameters:
context
- the original context to renderdata
- aSafeHtml
stringsb
- theSafeHtmlBuilder
to be written to
-
onEnterKeyDown
protected void onEnterKeyDown(Cell.Context context, Element parent, java.lang.String value, NativeEvent event, ValueUpdater<java.lang.String> valueUpdater)
Description copied from class:AbstractCell
Called when the user triggers akeydown
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 consumekeydown
events for this method to be called.- Overrides:
onEnterKeyDown
in classAbstractCell<java.lang.String>
- Parameters:
context
- theCell.Context
of the cellparent
- the parent Elementvalue
- the value associated with the cellevent
- the native browser eventvalueUpdater
- aValueUpdater
, or null if not specified
-
-