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
Cell.Context
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. |
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.
|
void |
onEmpty(XElement parent,
boolean empty) |
boolean |
resetFocus(Cell.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(Cell.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.
|
finishEditing, getHeight, getWidth, handlesSelection, isDisabled, isReadOnly, onBrowserEvent, onValid, redrawOnResize, setHeight, setReadOnly, setSize, setSize, setWidth
addHandler, fireEvent, isDisableEvents, setDisableEvents
isEditing
clearViewData, getViewData, setViewData
dependsOnSelection, getConsumedEvents, render, setValue
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)
getInputElement
in class AbstractInputCell<T,FieldCell.FieldViewData>
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(Cell.Context context, Element parent, T value)
resetFocus
in interface Cell<T>
resetFocus
in class AbstractInputCell<T,FieldCell.FieldViewData>
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(Cell.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)
AbstractCell.setValue(com.google.gwt.cell.client.Cell.Context, com.google.gwt.dom.client.Element, C)
.parent
- the parent elementtext
- the textCopyright © 2015. All rights reserved.