public abstract class FieldCell<T> extends AbstractEventInputCell<T,FieldCell.FieldViewData> implements ResizableCell
Modifier and Type | Class and Description |
---|---|
static interface |
FieldCell.FieldAppearance |
static class |
FieldCell.FieldAppearanceOptions |
static class |
FieldCell.FieldViewData |
Modifier and Type | Field and Description |
---|---|
protected boolean |
bypassClearContext |
protected Context |
focusContext |
protected int |
height |
protected Context |
lastContext |
protected XElement |
lastParent |
protected T |
lastValue |
protected <any> |
lastValueUpdater |
protected int |
width |
Constructor and Description |
---|
FieldCell(FieldCell.FieldAppearance appearance,
Set<String> consumedEvents) |
FieldCell(FieldCell.FieldAppearance appearance,
String... consumedEvents) |
Modifier and Type | Method and Description |
---|---|
protected FieldCell.FieldViewData |
checkViewData(Context context,
String value) |
protected void |
clearContext() |
void |
disable(XElement parent)
Disables the cell.
|
void |
enable(XElement parent)
Enables the cell.
|
protected FieldCell.FieldViewData |
ensureViewData(Context context,
XElement parent) |
void |
finishEditing(Element parent,
T value,
Object key,
<any> valueUpdater) |
FieldCell.FieldAppearance |
getAppearance()
Returns the appearance implementation used by this cell instance
|
int |
getHeight()
Returns the height.
|
int |
getWidth()
Returns the width.
|
boolean |
handlesSelection() |
protected boolean |
hasFocus(Context context,
XElement parent) |
boolean |
isDisabled()
Returns the cell's disabled state.
|
boolean |
isReadOnly()
Returns the cell's read only state.
|
protected void |
onBlur(Context context,
XElement parent,
T value,
NativeEvent event,
<any> valueUpdateer) |
void |
onBrowserEvent(Context context,
Element parent,
T value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onClick(XElement x,
NativeEvent event) |
abstract void |
onEmpty(XElement parent,
boolean empty) |
protected void |
onFocus(Context context,
XElement parent,
T value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onKeyDown(Context context,
Element parent,
T value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onKeyPress(Context context,
Element parent,
T value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onKeyUp(Context context,
Element parent,
T value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onMouseDown(XElement parent,
NativeEvent event) |
protected void |
onMouseOut(XElement parent,
NativeEvent event) |
protected void |
onMouseOver(XElement parent,
NativeEvent event) |
protected void |
onMouseUp(XElement parent,
NativeEvent event) |
protected void |
onNavigationKey(Context context,
Element parent,
T value,
NativeEvent event,
<any> valueUpdater) |
void |
onValid(XElement parent,
boolean valid) |
boolean |
redrawOnResize()
Determines if the cell should be redrawn when resized by @link
CellComponent . |
protected void |
saveContext(Context context,
Element parent,
NativeEvent event,
<any> valueUpdater,
T value) |
void |
setHeight(int height)
Sets the height.
|
void |
setName(XElement parent,
String name)
Sets the name attribute on the input element.
|
void |
setReadOnly(boolean readOnly)
Sets the field's read only state.
|
void |
setSize(int width,
int height)
Sets the cell size.
|
void |
setSize(XElement parent,
int width,
int height)
Sets the size of the cell without requiring a redraw.
|
void |
setWidth(int width)
Sets the width.
|
addCellGestureAdapter, addHandler, createHandlerManager, fireCancellableEvent, fireCancellableEvent, fireEvent, fireEvent, getCellGestureAdapter, getCellGestureAdapterCount, getConsumedEvents, isDisableEvents, onTouch, removeCellGestureAdapter, setDisableEvents
protected boolean bypassClearContext
protected int height
protected Context lastContext
protected XElement lastParent
protected T lastValue
protected <any> lastValueUpdater
protected int width
protected Context focusContext
public FieldCell(FieldCell.FieldAppearance appearance, Set<String> consumedEvents)
public FieldCell(FieldCell.FieldAppearance appearance, String... consumedEvents)
public boolean handlesSelection()
public void disable(XElement parent)
parent
- the parent elementpublic void enable(XElement parent)
parent
- the parent elementpublic FieldCell.FieldAppearance getAppearance()
public int getHeight()
ResizableCell
getHeight
in interface ResizableCell
public int getWidth()
ResizableCell
getWidth
in interface ResizableCell
public boolean isDisabled()
public boolean isReadOnly()
public void onBrowserEvent(Context context, Element parent, T value, NativeEvent event, <any> valueUpdater)
onBrowserEvent
in class AbstractEventInputCell<T,FieldCell.FieldViewData>
protected void onNavigationKey(Context context, Element parent, T value, NativeEvent event, <any> valueUpdater)
public abstract void onEmpty(XElement parent, boolean empty)
public void onValid(XElement parent, boolean valid)
public boolean redrawOnResize()
ResizableCell
CellComponent
. If true, CellComponent.redraw()
will be
called.redrawOnResize
in interface ResizableCell
public void setHeight(int height)
ResizableCell
setHeight
in interface ResizableCell
height
- the height in pixelspublic void setName(XElement parent, String name)
parent
- the parentname
- the namepublic void setReadOnly(boolean readOnly)
readOnly
- the read only statepublic void setSize(int width, int height)
ResizableCell
setSize
in interface ResizableCell
width
- the width in pixelsheight
- the height in pixelspublic void setSize(XElement parent, int width, int height)
ResizableCell
CellComponent
when ResizableCell.redrawOnResize()
returns false.setSize
in interface ResizableCell
parent
- the parent elementwidth
- the widthheight
- the heightpublic void setWidth(int width)
ResizableCell
setWidth
in interface ResizableCell
width
- the width in pixelsprotected FieldCell.FieldViewData checkViewData(Context context, String value)
protected void clearContext()
protected FieldCell.FieldViewData ensureViewData(Context context, XElement parent)
protected boolean hasFocus(Context context, XElement parent)
protected void onBlur(Context context, XElement parent, T value, NativeEvent event, <any> valueUpdateer)
protected void onClick(XElement x, NativeEvent event)
protected void onFocus(Context context, XElement parent, T value, NativeEvent event, <any> valueUpdater)
protected void onKeyDown(Context context, Element parent, T value, NativeEvent event, <any> valueUpdater)
protected void onKeyPress(Context context, Element parent, T value, NativeEvent event, <any> valueUpdater)
protected void onKeyUp(Context context, Element parent, T value, NativeEvent event, <any> valueUpdater)
protected void onMouseDown(XElement parent, NativeEvent event)
protected void onMouseOut(XElement parent, NativeEvent event)
protected void onMouseOver(XElement parent, NativeEvent event)
protected void onMouseUp(XElement parent, NativeEvent event)
protected void saveContext(Context context, Element parent, NativeEvent event, <any> valueUpdater, T value)
Copyright © 2018. All rights reserved.