T
- the data typepublic abstract class ValueBaseInputCell<T> extends FieldCell<T> implements ParseErrorEvent.HasParseErrorHandlers, FocusableCell
FieldCell
which has an input element.Modifier and Type | Class and Description |
---|---|
static interface |
ValueBaseInputCell.ValueBaseFieldAppearance |
FieldCell.FieldAppearance, FieldCell.FieldAppearanceOptions, FieldCell.FieldViewData
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowBlank |
protected boolean |
finishEditOnBlur
True to finish the edit if a blur is fired without a change event for browsers that do fire change events when
blurring the browser window.
|
protected static TextBoxImpl |
impl |
protected String |
name |
protected PropertyEditor<T> |
propertyEditor |
bypassClearContext, focusContext, height, lastContext, lastParent, lastValue, lastValueUpdater, width
Constructor and Description |
---|
ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance)
Creates a new cell instance.
|
ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance,
Set<String> consumedEvents)
Creates a new cell instance.
|
ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance,
String... consumedEvents)
Creates a new cell instance.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addParseErrorHandler(ParseErrorEvent.ParseErrorHandler handler)
Adds a
ParseErrorEvent.ParseErrorHandler handler for ParseErrorEvent
events. |
protected void |
applyEmptyText(Context context,
XElement parent) |
void |
disable(XElement parent)
Disables the cell.
|
void |
enable(XElement parent)
Enables the cell.
|
ValueBaseInputCell.ValueBaseFieldAppearance |
getAppearance()
Returns the cell's appearance.
|
int |
getCursorPos(XElement parent)
Gets the current position of the cursor (this also serves as the beginning of the text selection).
|
String |
getEmptyText()
Returns the cell's empty text.
|
XElement |
getFocusElement(XElement parent) |
InputElement |
getInputElement(Element parent) |
String |
getName()
Returns the field's name.
|
PropertyEditor<T> |
getPropertyEditor()
Returns the cell's property editor.
|
String |
getText(XElement parent)
Returns the cell's raw text.
|
boolean |
isAllowBlank()
Returns the field's allow blank state.
|
boolean |
isClearValueOnParseError()
Returns true if the current value is cleared on a parse error.
|
boolean |
isSelectOnFocus()
Returns the select of focus state.
|
protected void |
onBlur(Context context,
XElement parent,
T value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onClick(XElement parent,
NativeEvent event) |
void |
onEmpty(XElement parent,
boolean empty) |
protected void |
onFocus(Context context,
XElement parent,
T value,
NativeEvent event,
<any> updater) |
protected void |
onKeyUp(Context context,
XElement parent,
T value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onMouseDown(XElement parent,
NativeEvent event) |
protected void |
onTap(TouchData t,
Context context,
Element parent,
T value,
<any> valueUpdater) |
protected void |
removeEmptyText(XElement parent) |
boolean |
resetFocus(Context context,
Element parent,
T value) |
void |
select(XElement parent,
int start,
int length)
Selects the text.
|
void |
selectAll(XElement parent)
Selects all the text.
|
void |
setAllowBlank(boolean allowBlank)
Sets whether a field is valid when its value length = 0 (default to true).
|
void |
setClearValueOnParseError(boolean clearValueOnParseError)
True to clear the current value when a parse error occurs (defaults to true).
|
void |
setCursorPos(XElement parent,
int pos)
Sets the cursor position.
|
void |
setEmptyText(Context context,
XElement parent,
String emptyText)
Sets the default text to display in an empty field (defaults to null).
|
void |
setName(XElement parent,
String name)
Sets the name attribute on the input element.
|
void |
setPropertyEditor(PropertyEditor<T> propertyEditor)
Sets the field's property editor which is used to translate typed values to string, and string values back to typed
values.
|
void |
setSelectOnFocus(boolean selectOnFocus)
True to automatically select any existing field text when the field receives input focus (defaults to false).
|
void |
setText(XElement parent,
String text)
Sets the underlying DOM field's value directly, bypassing validation.
|
checkViewData, clearContext, ensureViewData, finishEditing, getHeight, getWidth, handlesSelection, hasFocus, isDisabled, isReadOnly, onBrowserEvent, 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
protected static TextBoxImpl impl
protected boolean finishEditOnBlur
protected PropertyEditor<T> propertyEditor
protected String name
protected boolean allowBlank
public ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance)
appearance
- the appearancepublic ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance, Set<String> consumedEvents)
appearance
- the appearanceconsumedEvents
- the consumed eventspublic ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance, String... consumedEvents)
appearance
- the appearanceconsumedEvents
- the consumed eventspublic HandlerRegistration addParseErrorHandler(ParseErrorEvent.ParseErrorHandler handler)
ParseErrorEvent.HasParseErrorHandlers
ParseErrorEvent.ParseErrorHandler
handler for ParseErrorEvent
events.addParseErrorHandler
in interface ParseErrorEvent.HasParseErrorHandlers
handler
- the handlerpublic void disable(XElement parent)
FieldCell
public void enable(XElement parent)
FieldCell
public ValueBaseInputCell.ValueBaseFieldAppearance getAppearance()
getAppearance
in class FieldCell<T>
public int getCursorPos(XElement parent)
parent
- the parentpublic String getEmptyText()
public XElement getFocusElement(XElement parent)
getFocusElement
in interface FocusableCell
public InputElement getInputElement(Element parent)
public String getName()
public PropertyEditor<T> getPropertyEditor()
public String getText(XElement parent)
parent
- the parent elementpublic boolean isAllowBlank()
public boolean isClearValueOnParseError()
public boolean isSelectOnFocus()
public void onEmpty(XElement parent, boolean empty)
public boolean resetFocus(Context context, Element parent, T value)
public void select(XElement parent, int start, int length)
parent
- the parent elementstart
- the start indexlength
- the selection lengthpublic void selectAll(XElement parent)
parent
- the parentpublic void setAllowBlank(boolean allowBlank)
allowBlank
- true to allow blanks, false otherwisepublic void setClearValueOnParseError(boolean clearValueOnParseError)
clearValueOnParseError
- true to clean the value on parse errorpublic void setCursorPos(XElement parent, int pos)
parent
- the parentpos
- the new cursor positionpublic void setEmptyText(Context context, XElement parent, String emptyText)
context
- the contextparent
- the parentemptyText
- the empty textpublic void setName(XElement parent, String name)
FieldCell
public void setPropertyEditor(PropertyEditor<T> propertyEditor)
propertyEditor
- the property editorpublic void setSelectOnFocus(boolean selectOnFocus)
selectOnFocus
- true to focuspublic void setText(XElement parent, String text)
#setValue
.parent
- the parent elementtext
- the textprotected void applyEmptyText(Context context, XElement parent)
protected void onBlur(Context context, XElement parent, T value, NativeEvent event, <any> valueUpdater)
protected void onClick(XElement parent, NativeEvent event)
protected void onFocus(Context context, XElement parent, T value, NativeEvent event, <any> updater)
protected void onKeyUp(Context context, XElement parent, T value, NativeEvent event, <any> valueUpdater)
protected void onMouseDown(XElement parent, NativeEvent event)
onMouseDown
in class FieldCell<T>
protected void onTap(TouchData t, Context context, Element parent, T value, <any> valueUpdater)
protected void removeEmptyText(XElement parent)
Copyright © 2018. All rights reserved.