|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<String>
com.vaadin.ui.AbstractTextField
public abstract class AbstractTextField
| Nested Class Summary | |
|---|---|
class |
AbstractTextField.TextChangeEventImpl
|
static class |
AbstractTextField.TextChangeEventMode
Different modes how the TextField can trigger FieldEvents.TextChangeEvents. |
| Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
|---|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent |
| Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
|---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
| Nested classes/interfaces inherited from interface com.vaadin.terminal.VariableOwner |
|---|
VariableOwner.ErrorEvent |
| Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
|---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener, Component.RepaintRequestEvent, Component.RepaintRequestListener |
| Nested classes/interfaces inherited from interface com.vaadin.terminal.Sizeable |
|---|
Sizeable.Unit |
| Nested classes/interfaces inherited from interface com.vaadin.ui.Field |
|---|
Field.ValueChangeEvent |
| Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
|---|
Buffered.SourceException |
| Nested classes/interfaces inherited from interface com.vaadin.data.Property |
|---|
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
| Field Summary |
|---|
| Fields inherited from interface com.vaadin.terminal.Sizeable |
|---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
| Constructor Summary | |
|---|---|
protected |
AbstractTextField()
|
| Method Summary | |
|---|---|
void |
addListener(FieldEvents.BlurListener listener)
Adds a BlurListener to the Component which gets fired
when a Field loses keyboard focus. |
void |
addListener(FieldEvents.FocusListener listener)
Adds a FocusListener to the Component which gets fired
when a Field receives keyboard focus. |
void |
addListener(FieldEvents.TextChangeListener listener)
|
void |
changeVariables(Object source,
Map<String,Object> variables)
Called when one or more variables handled by the implementing class are changed. |
int |
getColumns()
Gets the number of columns in the editor. |
int |
getCursorPosition()
Returns the last known cursor position of the field. |
Format |
getFormat()
Deprecated. replaced by PropertyFormatter |
protected String |
getFormattedValue()
Deprecated. |
String |
getInputPrompt()
Gets the current input prompt. |
int |
getMaxLength()
Returns the maximum number of characters in the field. |
String |
getNullRepresentation()
Gets the null-string representation. |
AbstractTextField.TextChangeEventMode |
getTextChangeEventMode()
|
int |
getTextChangeTimeout()
Gets the timeout used to fire FieldEvents.TextChangeEvents when the
getTextChangeEventMode() is AbstractTextField.TextChangeEventMode.LAZY or
AbstractTextField.TextChangeEventMode.TIMEOUT. |
Class<String> |
getType()
Returns the type of the Field. |
String |
getValue()
Gets the current value of the field. |
protected boolean |
isEmpty()
Is the field empty? In general, "empty" state is same as null. |
boolean |
isNullSettingAllowed()
Is setting nulls with null-string representation allowed. |
void |
paintContent(PaintTarget target)
Paints the Paintable into a UIDL stream. |
void |
removeListener(FieldEvents.BlurListener listener)
Removes a BlurListener from the Component. |
void |
removeListener(FieldEvents.FocusListener listener)
Removes a FocusListener from the Component. |
void |
removeListener(FieldEvents.TextChangeListener listener)
|
void |
selectAll()
Selects all text in the field. |
void |
setColumns(int columns)
Sets the number of columns in the editor. |
void |
setCursorPosition(int pos)
Sets the cursor position in the field. |
void |
setFormat(Format format)
Deprecated. replaced by PropertyFormatter |
void |
setInputPrompt(String inputPrompt)
Sets the input prompt - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input. |
protected void |
setInternalValue(String newValue)
Sets the internal field value. |
void |
setMaxLength(int maxLength)
Sets the maximum number of characters in the field. |
void |
setNullRepresentation(String nullRepresentation)
Sets the null-string representation. |
void |
setNullSettingAllowed(boolean nullSettingAllowed)
Sets the null conversion mode. |
void |
setSelectionRange(int pos,
int length)
Sets the range of text to be selected. |
void |
setTextChangeEventMode(AbstractTextField.TextChangeEventMode inputEventMode)
Sets the mode how the TextField triggers FieldEvents.TextChangeEvents. |
void |
setTextChangeTimeout(int timeout)
The text change timeout modifies how often text change events are communicated to the application when getTextChangeEventMode() is
AbstractTextField.TextChangeEventMode.LAZY or AbstractTextField.TextChangeEventMode.TIMEOUT. |
void |
setValue(Object newValue)
Sets the value of the field. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.vaadin.terminal.VariableOwner |
|---|
isEnabled, isImmediate |
| Methods inherited from interface com.vaadin.ui.Component |
|---|
addListener, addListener, addStyleName, attach, detach, getApplication, getCaption, getDebugId, getIcon, getLocale, getParent, getRoot, getState, getStyleName, isEnabled, isReadOnly, isVisible, removeListener, removeListener, removeStyleName, requestRepaint, setCaption, setDebugId, setEnabled, setIcon, setParent, setReadOnly, setStyleName, setVisible, updateState |
| Methods inherited from interface com.vaadin.terminal.gwt.server.ClientConnector |
|---|
isConnectorEnabled, retrievePendingRpcCalls |
| Methods inherited from interface com.vaadin.terminal.gwt.client.Connector |
|---|
getConnectorId |
| Methods inherited from interface com.vaadin.terminal.gwt.server.RpcTarget |
|---|
getRpcManager |
| Methods inherited from interface com.vaadin.terminal.Sizeable |
|---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth |
| Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier |
|---|
addShortcutListener, removeShortcutListener |
| Constructor Detail |
|---|
protected AbstractTextField()
| Method Detail |
|---|
public void paintContent(PaintTarget target)
throws PaintException
Vaadin6ComponentPaints the Paintable into a UIDL stream. This method creates the UIDL sequence describing it and outputs it to the given UIDL stream.
It is called when the contents of the component should be painted in response to the component first being shown or having been altered so that its visual representation is changed.
paintContent in interface Vaadin6Componenttarget - the target UIDL stream where the component should paint itself
to.
PaintException - if the paint operation failed.@Deprecated protected String getFormattedValue()
setFormat(Format),
Formatpublic String getValue()
AbstractFieldThis is the visible, modified and possible invalid value the user have entered to the field.
Note that the object returned is compatible with getType(). For example,
if the type is String, this returns Strings even when the underlying
datasource is of some other type. In order to access the converted value,
use AbstractField.getConvertedValue() and to access the value of the property
data source, use Property.getValue() for the property data
source.
Since Vaadin 7.0, no implicit conversions between other data types and String are performed, but a converter is used if set.
getValue in interface Property<String>getValue in class AbstractField<String>
public void changeVariables(Object source,
Map<String,Object> variables)
VariableOwner
changeVariables in interface VariableOwnersource - the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables - the Mapping from variable names to new variable values.public Class<String> getType()
AbstractFieldgetValue and
setValue must be compatible with this type: one must be able
to safely cast the value returned from getValue to the given
type and pass any variable assignable to this type as an argument to
setValue.
getType in interface Property<String>getType in class AbstractField<String>public String getNullRepresentation()
The null-valued strings are represented on the user interface by replacing the null value with this string. If the null representation is set null (not 'null' string), painting null value throws exception.
The default value is string 'null'.
isNullSettingAllowed()public boolean isNullSettingAllowed()
If this property is true, writing null-representation string to text field always sets the field value to real null. If this property is false, null setting is not made, but the null values are maintained. Maintenance of null-values is made by only converting the textfield contents to real null, if the text field matches the null-string representation and the current value of the field is null.
By default this setting is false
getNullRepresentation()public void setNullRepresentation(String nullRepresentation)
The null-valued strings are represented on the user interface by replacing the null value with this string. If the null representation is set null (not 'null' string), painting null value throws exception.
The default value is string 'null'
nullRepresentation - Textual representation for null strings.setNullSettingAllowed(boolean)public void setNullSettingAllowed(boolean nullSettingAllowed)
If this property is true, writing null-representation string to text field always sets the field value to real null. If this property is false, null setting is not made, but the null values are maintained. Maintenance of null-values is made by only converting the textfield contents to real null, if the text field matches the null-string representation and the current value of the field is null.
By default this setting is false.
nullSettingAllowed - Should the null-string representation always be converted to
null-values.getNullRepresentation()@Deprecated public Format getFormat()
PropertyFormatter
@Deprecated public void setFormat(Format format)
PropertyFormatter
format - the Format used to format the value. Null disables the
formatting.protected boolean isEmpty()
AbstractField
isEmpty in class AbstractField<String>public int getMaxLength()
public void setMaxLength(int maxLength)
maxLength - the maxLength to setpublic int getColumns()
public void setColumns(int columns)
columns - the number of columns to set.public String getInputPrompt()
setInputPrompt(String)public void setInputPrompt(String inputPrompt)
inputPrompt - protected void setInternalValue(String newValue)
AbstractFieldAbstractField.getInternalValue() if necessary.
setInternalValue in class AbstractField<String>newValue - the new value to be set.
public void setValue(Object newValue)
throws Property.ReadOnlyException
AbstractField
setValue in interface Property<String>setValue in class AbstractField<String>newValue - the New value of the field.
Property.ReadOnlyException - if the object is in read-only modepublic void setTextChangeEventMode(AbstractTextField.TextChangeEventMode inputEventMode)
FieldEvents.TextChangeEvents.
inputEventMode - the new modeAbstractTextField.TextChangeEventModepublic AbstractTextField.TextChangeEventMode getTextChangeEventMode()
FieldEvents.TextChangeEvents.public void addListener(FieldEvents.TextChangeListener listener)
addListener in interface FieldEvents.TextChangeNotifierpublic void removeListener(FieldEvents.TextChangeListener listener)
removeListener in interface FieldEvents.TextChangeNotifierpublic void setTextChangeTimeout(int timeout)
getTextChangeEventMode() is
AbstractTextField.TextChangeEventMode.LAZY or AbstractTextField.TextChangeEventMode.TIMEOUT.
timeout - the timeout in millisecondsgetTextChangeEventMode()public int getTextChangeTimeout()
FieldEvents.TextChangeEvents when the
getTextChangeEventMode() is AbstractTextField.TextChangeEventMode.LAZY or
AbstractTextField.TextChangeEventMode.TIMEOUT.
public void selectAll()
public void setSelectionRange(int pos,
int length)
pos - the position of the first character to be selectedlength - the number of characters to be selectedpublic void setCursorPosition(int pos)
pos - the position for the cursorpublic int getCursorPosition()
Note that due to the client server nature or the GWT terminal, Vaadin
cannot provide the exact value of the cursor position in most situations.
The value is updated only when the client side terminal communicates to
TextField, like on ValueChangeEvents and FieldEvents.TextChangeEvent
s. This may change later if a deep push integration is built to Vaadin.
public void addListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifierFocusListener to the Component which gets fired
when a Field receives keyboard focus.
addListener in interface FieldEvents.FocusNotifierFieldEvents.FocusListenerpublic void removeListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifierFocusListener from the Component.
removeListener in interface FieldEvents.FocusNotifierFieldEvents.FocusListenerpublic void addListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifierBlurListener to the Component which gets fired
when a Field loses keyboard focus.
addListener in interface FieldEvents.BlurNotifierFieldEvents.BlurListenerpublic void removeListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifierBlurListener from the Component.
removeListener in interface FieldEvents.BlurNotifierFieldEvents.BlurListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||