com.sencha.gxt.cell.core.client.form
Class ValueBaseInputCell<T>

java.lang.Object
  extended by com.google.gwt.cell.client.AbstractCell<C>
      extended by com.google.gwt.cell.client.AbstractEditableCell<C,V>
          extended by com.google.gwt.cell.client.AbstractInputCell<T,V>
              extended by com.sencha.gxt.cell.core.client.AbstractEventInputCell<T,FieldCell.FieldViewData>
                  extended by com.sencha.gxt.cell.core.client.form.FieldCell<T>
                      extended by com.sencha.gxt.cell.core.client.form.ValueBaseInputCell<T>
Type Parameters:
T - the data type
All Implemented Interfaces:
Cell<T>, ResizableCell, ParseErrorEvent.HasParseErrorHandlers
Direct Known Subclasses:
CheckBoxCell, TextAreaInputCell, TextInputCell, TriggerFieldCell

public abstract class ValueBaseInputCell<T>
extends FieldCell<T>
implements ParseErrorEvent.HasParseErrorHandlers

A FieldCell which has an input element.


Nested Class Summary
static interface ValueBaseInputCell.ValueBaseFieldAppearance
           
 
Nested classes/interfaces inherited from class com.sencha.gxt.cell.core.client.form.FieldCell
FieldCell.FieldAppearance, FieldCell.FieldAppearanceOptions, FieldCell.FieldViewData
 
Nested classes/interfaces inherited from interface com.google.gwt.cell.client.Cell
Cell.Context
 
Constructor Summary
ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance)
           
ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance, Set<String> consumedEvents)
           
ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance, String... consumedEvents)
           
 
Method Summary
 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.
 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 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 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)
           
 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.
 
Methods inherited from class com.sencha.gxt.cell.core.client.form.FieldCell
finishEditing, getHeight, getWidth, handlesSelection, isDisabled, isReadOnly, onBrowserEvent, onValid, redrawOnResize, setHeight, setReadOnly, setSize, setSize, setWidth
 
Methods inherited from class com.sencha.gxt.cell.core.client.AbstractEventInputCell
addHandler, fireEvent, isDisableEvents, setDisableEvents
 
Methods inherited from class com.google.gwt.cell.client.AbstractInputCell
isEditing
 
Methods inherited from class com.google.gwt.cell.client.AbstractEditableCell
clearViewData, getViewData, setViewData
 
Methods inherited from class com.google.gwt.cell.client.AbstractCell
dependsOnSelection, getConsumedEvents, render, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueBaseInputCell

public ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance)

ValueBaseInputCell

public ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance,
                          Set<String> consumedEvents)

ValueBaseInputCell

public ValueBaseInputCell(ValueBaseInputCell.ValueBaseFieldAppearance appearance,
                          String... consumedEvents)
Method Detail

addParseErrorHandler

public HandlerRegistration addParseErrorHandler(ParseErrorEvent.ParseErrorHandler handler)
Description copied from interface: ParseErrorEvent.HasParseErrorHandlers
Adds a ParseErrorEvent.ParseErrorHandler handler for ParseErrorEvent events.

Specified by:
addParseErrorHandler in interface ParseErrorEvent.HasParseErrorHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

disable

public void disable(XElement parent)
Description copied from class: FieldCell
Disables the cell.

Overrides:
disable in class FieldCell<T>
Parameters:
parent - the parent element

enable

public void enable(XElement parent)
Description copied from class: FieldCell
Enables the cell.

Overrides:
enable in class FieldCell<T>
Parameters:
parent - the parent element

getAppearance

public ValueBaseInputCell.ValueBaseFieldAppearance getAppearance()
Returns the cell's appearance.

Returns:
the appearance

getCursorPos

public int getCursorPos(XElement parent)
Gets the current position of the cursor (this also serves as the beginning of the text selection).

Parameters:
parent - the parent
Returns:
the cursor's position

getEmptyText

public String getEmptyText()
Returns the cell's empty text.

Returns:
the empty text

getInputElement

public InputElement getInputElement(Element parent)
Overrides:
getInputElement in class AbstractInputCell<T,FieldCell.FieldViewData>

getName

public String getName()
Returns the field's name.

Returns:
the name

getPropertyEditor

public PropertyEditor<T> getPropertyEditor()
Returns the cell's property editor.

Returns:
the property editor

getText

public String getText(XElement parent)
Returns the cell's raw text.

Parameters:
parent - the parent element
Returns:
text from the input field

isAllowBlank

public boolean isAllowBlank()
Returns the field's allow blank state.

Returns:
true if blank values are allowed

isSelectOnFocus

public boolean isSelectOnFocus()
Returns the select of focus state.

Returns:
true if select on focus is enabled

onEmpty

public void onEmpty(XElement parent,
                    boolean empty)
Specified by:
onEmpty in class FieldCell<T>

resetFocus

public boolean resetFocus(Cell.Context context,
                          Element parent,
                          T value)
Specified by:
resetFocus in interface Cell<T>
Overrides:
resetFocus in class AbstractInputCell<T,FieldCell.FieldViewData>

select

public void select(XElement parent,
                   int start,
                   int length)
Selects the text.

Parameters:
parent - the parent element
start - the start index
length - the selection length

selectAll

public void selectAll(XElement parent)
Selects all the text.

Parameters:
parent - the parent

setAllowBlank

public void setAllowBlank(boolean allowBlank)
Sets whether a field is valid when its value length = 0 (default to true).

Parameters:
allowBlank - true to allow blanks, false otherwise

setCursorPos

public void setCursorPos(XElement parent,
                         int pos)
Sets the cursor position. This will only work when the widget is attached to the document and not hidden.

Parameters:
parent - the parent
pos - the new cursor position

setEmptyText

public void setEmptyText(Cell.Context context,
                         XElement parent,
                         String emptyText)
Sets the default text to display in an empty field (defaults to null).

Parameters:
context - the context
parent - the parent
emptyText - the empty text

setName

public void setName(XElement parent,
                    String name)
Overrides:
setName in class FieldCell<T>

setPropertyEditor

public 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.

Parameters:
propertyEditor - the property editor

setSelectOnFocus

public void setSelectOnFocus(boolean selectOnFocus)
True to automatically select any existing field text when the field receives input focus (defaults to false).

Parameters:
selectOnFocus - true to focus

setText

public void setText(XElement parent,
                    String text)
Sets the underlying DOM field's value directly, bypassing validation. This method does not update the field's value. To set the value with validation see AbstractCell.setValue(com.google.gwt.cell.client.Cell.Context, com.google.gwt.dom.client.Element, C).

Parameters:
parent - the parent element
text - the text


Copyright © 2012. All Rights Reserved.