public class CheckboxCell extends AbstractEditableCell<java.lang.Boolean,java.lang.Boolean>
Cell
used to render a checkbox. The value of the checkbox may be
toggled using the ENTER key as well as via mouse click.Cell.Context
Constructor and Description |
---|
CheckboxCell()
Construct a new
CheckboxCell . |
CheckboxCell(boolean isSelectBox)
Deprecated.
use
CheckboxCell(boolean, boolean) instead |
CheckboxCell(boolean dependsOnSelection,
boolean handlesSelection)
Construct a new
CheckboxCell that optionally controls selection. |
Modifier and Type | Method and Description |
---|---|
boolean |
dependsOnSelection()
Check if this cell depends on the selection state.
|
boolean |
handlesSelection()
Check if this cell handles selection.
|
boolean |
isEditing(Cell.Context context,
Element parent,
java.lang.Boolean value)
Returns true if the cell is currently editing the data identified by the
given element and key.
|
void |
onBrowserEvent(Cell.Context context,
Element parent,
java.lang.Boolean value,
NativeEvent event,
ValueUpdater<java.lang.Boolean> valueUpdater)
Handle a browser event that took place within the cell.
|
void |
render(Cell.Context context,
java.lang.Boolean value,
SafeHtmlBuilder sb)
Render a cell as HTML into a
SafeHtmlBuilder , suitable for passing
to Element.setInnerHTML(String) on a container element. |
clearViewData, getViewData, setViewData
getConsumedEvents, onEnterKeyDown, resetFocus, setValue
public CheckboxCell()
CheckboxCell
.@Deprecated public CheckboxCell(boolean isSelectBox)
CheckboxCell(boolean, boolean)
insteadCheckboxCell
that optionally controls selection.isSelectBox
- true if the cell controls the selection statepublic CheckboxCell(boolean dependsOnSelection, boolean handlesSelection)
CheckboxCell
that optionally controls selection.dependsOnSelection
- true if the cell depends on the selection statehandlesSelection
- true if the cell modifies the selection statepublic boolean dependsOnSelection()
Cell
dependsOnSelection
in interface Cell<java.lang.Boolean>
dependsOnSelection
in class AbstractCell<java.lang.Boolean>
public boolean handlesSelection()
Cell
handlesSelection
in interface Cell<java.lang.Boolean>
handlesSelection
in class AbstractCell<java.lang.Boolean>
public boolean isEditing(Cell.Context context, Element parent, java.lang.Boolean value)
AbstractEditableCell
isEditing
in interface Cell<java.lang.Boolean>
isEditing
in class AbstractEditableCell<java.lang.Boolean,java.lang.Boolean>
context
- the Context
of the cellparent
- the parent Elementvalue
- the value associated with the cellpublic void onBrowserEvent(Cell.Context context, Element parent, java.lang.Boolean value, NativeEvent event, ValueUpdater<java.lang.Boolean> 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<java.lang.Boolean>
onBrowserEvent
in class AbstractCell<java.lang.Boolean>
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, java.lang.Boolean 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<java.lang.Boolean>
render
in class AbstractCell<java.lang.Boolean>
context
- the Cell.Context
of the cellvalue
- the cell value to be renderedsb
- the SafeHtmlBuilder
to be written to