public class CheckBoxCell extends ValueBaseInputCell<Boolean>
Renders an HTML check box.
To avoid increasing the row height when used in a Grid
you can adjust the grids cell padding with this code:
ColumnConfig<Stock, Boolean> splitCol = new ColumnConfig<Stock, Boolean>(props.split(), 50, "Split"); splitCol.setCell(new CheckBoxCell()); // reduce the padding on text element as we have widgets in the cells SafeStyles textStyles = SafeStylesUtils.fromTrustedString("padding: 1px 3px;"); splitCol.setColumnTextStyle(textStyles);
Modifier and Type | Class and Description |
---|---|
static interface |
CheckBoxCell.CheckBoxAppearance |
static class |
CheckBoxCell.CheckBoxCellOptions |
ValueBaseInputCell.ValueBaseFieldAppearance
FieldCell.FieldAppearance, FieldCell.FieldAppearanceOptions, FieldCell.FieldViewData
allowBlank, finishEditOnBlur, impl, name, propertyEditor
bypassClearContext, focusContext, height, lastContext, lastParent, lastValue, lastValueUpdater, width
Constructor and Description |
---|
CheckBoxCell() |
CheckBoxCell(CheckBoxCell.CheckBoxAppearance appearance) |
Modifier and Type | Method and Description |
---|---|
CheckBoxCell.CheckBoxAppearance |
getAppearance()
Returns the cell's appearance.
|
SafeHtml |
getBoxLabel() |
boolean |
isEditing(Context context,
Element parent,
Boolean value) |
protected void |
onBlur(com.google.gwt.cell.client.Cell.Context context,
XElement parent,
Boolean value,
NativeEvent event,
<any> valueUpdater) |
void |
onBrowserEvent(Context context,
Element parent,
Boolean value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onEnterKeyDown(com.google.gwt.cell.client.Cell.Context context,
Element parent,
Boolean value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onMouseDown(XElement parent,
NativeEvent event) |
void |
render(com.google.gwt.cell.client.Cell.Context context,
Boolean value,
SafeHtmlBuilder sb) |
void |
setBoxLabel(XElement parent,
SafeHtml html)
The html that appears beside the checkbox (defaults to null).
|
void |
setBoxLabel(XElement parent,
String text)
The text that appears beside the checkbox (defaults to null).
|
addParseErrorHandler, applyEmptyText, disable, enable, getCursorPos, getEmptyText, getFocusElement, getInputElement, getName, getPropertyEditor, getText, isAllowBlank, isClearValueOnParseError, isSelectOnFocus, onClick, onEmpty, onFocus, onKeyUp, onTap, removeEmptyText, resetFocus, select, selectAll, setAllowBlank, setClearValueOnParseError, setCursorPos, setEmptyText, setName, setPropertyEditor, setSelectOnFocus, setText
checkViewData, clearContext, ensureViewData, finishEditing, getHeight, getWidth, handlesSelection, hasFocus, isDisabled, isReadOnly, onKeyDown, onKeyPress, onMouseOut, onMouseOver, onMouseUp, onNavigationKey, onValid, redrawOnResize, saveContext, setHeight, setReadOnly, setSize, setSize, setWidth
addCellGestureAdapter, addHandler, createHandlerManager, fireCancellableEvent, fireCancellableEvent, fireEvent, fireEvent, getCellGestureAdapter, getCellGestureAdapterCount, getConsumedEvents, isDisableEvents, onTouch, removeCellGestureAdapter, setDisableEvents
public CheckBoxCell()
public CheckBoxCell(CheckBoxCell.CheckBoxAppearance appearance)
public CheckBoxCell.CheckBoxAppearance getAppearance()
ValueBaseInputCell
getAppearance
in class ValueBaseInputCell<Boolean>
public SafeHtml getBoxLabel()
public boolean isEditing(Context context, Element parent, Boolean value)
public void onBrowserEvent(Context context, Element parent, Boolean value, NativeEvent event, <any> valueUpdater)
onBrowserEvent
in class FieldCell<Boolean>
protected void onMouseDown(XElement parent, NativeEvent event)
onMouseDown
in class ValueBaseInputCell<Boolean>
public void render(com.google.gwt.cell.client.Cell.Context context, Boolean value, SafeHtmlBuilder sb)
public void setBoxLabel(XElement parent, String text)
parent
- the parent elementtext
- the box label textpublic void setBoxLabel(XElement parent, SafeHtml html)
parent
- the parent elementhtml
- the box label htmlprotected void onBlur(com.google.gwt.cell.client.Cell.Context context, XElement parent, Boolean value, NativeEvent event, <any> valueUpdater)
onBlur
in class ValueBaseInputCell<Boolean>
protected void onEnterKeyDown(com.google.gwt.cell.client.Cell.Context context, Element parent, Boolean value, NativeEvent event, <any> valueUpdater)
Copyright © 2018. All rights reserved.