Class AbstractTextField
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.v7.ui.AbstractLegacyComponent
-
- com.vaadin.v7.ui.AbstractField<String>
-
- com.vaadin.v7.ui.AbstractTextField
-
- All Implemented Interfaces:
Action.ShortcutNotifier,ConnectorEventListener,ContextClickEvent.ContextClickNotifier,MethodEventSource,SerializableEventListener,ClientConnector,Sizeable,VariableOwner,com.vaadin.shared.Connector,Component,Component.Focusable,LegacyComponent,Buffered,BufferedValidatable,Property<String>,Property.Editor,Property.ReadOnlyStatusChangeListener,Property.ReadOnlyStatusChangeNotifier,Property.ValueChangeListener,Property.ValueChangeNotifier,Property.Viewer,Validatable,FieldEvents.BlurNotifier,FieldEvents.FocusNotifier,FieldEvents.TextChangeNotifier,Field<String>,Serializable,EventListener
- Direct Known Subclasses:
PasswordField,TextArea,TextField
@Deprecated public abstract class AbstractTextField extends AbstractField<String> implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, FieldEvents.TextChangeNotifier, LegacyComponent
Deprecated.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractTextField.TextChangeEventImplDeprecated.static classAbstractTextField.TextChangeEventModeDeprecated.-
Nested classes/interfaces inherited from class com.vaadin.v7.ui.AbstractField
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.Buffered
Buffered.SourceException
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.v7.ui.Field
Field.ValueChangeEvent
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTextField()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddBlurListener(FieldEvents.BlurListener listener)Deprecated.Adds aBlurListenerto the Component which gets fired when aFieldloses keyboard focus.voidaddFocusListener(FieldEvents.FocusListener listener)Deprecated.Adds aFocusListenerto the Component which gets fired when aFieldreceives keyboard focus.voidaddListener(FieldEvents.BlurListener listener)Deprecated.As of 7.0, replaced byaddBlurListener(BlurListener)voidaddListener(FieldEvents.FocusListener listener)Deprecated.As of 7.0, replaced byaddFocusListener(FocusListener)voidaddListener(FieldEvents.TextChangeListener listener)Deprecated.As of 7.0, replaced byaddTextChangeListener(TextChangeListener)voidaddTextChangeListener(FieldEvents.TextChangeListener listener)Deprecated.voidbeforeClientResponse(boolean initial)Deprecated.voidchangeVariables(Object source, Map<String,Object> variables)Deprecated.intgetColumns()Deprecated.Gets the number of columns in the editor.intgetCursorPosition()Deprecated.Returns the last known cursor position of the field.protected Collection<String>getCustomAttributes()Deprecated.StringgetInputPrompt()Deprecated.Gets the current input prompt.intgetMaxLength()Deprecated.Returns the maximum number of characters in the field.StringgetNullRepresentation()Deprecated.Gets the null-string representation.protected AbstractTextFieldStategetState()Deprecated.protected AbstractTextFieldStategetState(boolean markAsDirty)Deprecated.AbstractTextField.TextChangeEventModegetTextChangeEventMode()Deprecated.intgetTextChangeTimeout()Deprecated.Gets the timeout used to fireFieldEvents.TextChangeEvents when thegetTextChangeEventMode()isAbstractTextField.TextChangeEventMode.LAZYorAbstractTextField.TextChangeEventMode.TIMEOUT.Class<String>getType()Deprecated.Returns the type of the Field.booleanisEmpty()Deprecated.Is the field empty?booleanisNullSettingAllowed()Deprecated.Is setting nulls with null-string representation allowed.voidpaintContent(PaintTarget target)Deprecated.voidreadDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.voidremoveBlurListener(FieldEvents.BlurListener listener)Deprecated.Removes aBlurListenerfrom the Component.voidremoveFocusListener(FieldEvents.FocusListener listener)Deprecated.Removes aFocusListenerfrom the Component.voidremoveListener(FieldEvents.BlurListener listener)Deprecated.As of 7.0, replaced byremoveBlurListener(BlurListener)voidremoveListener(FieldEvents.FocusListener listener)Deprecated.As of 7.0, replaced byremoveFocusListener(FocusListener)voidremoveListener(FieldEvents.TextChangeListener listener)Deprecated.As of 7.0, replaced byremoveTextChangeListener(TextChangeListener)voidremoveTextChangeListener(FieldEvents.TextChangeListener listener)Deprecated.voidselectAll()Deprecated.Selects all text in the field.voidsetColumns(int columns)Deprecated.Sets the number of columns in the editor.voidsetCursorPosition(int pos)Deprecated.Sets the cursor position in the field.voidsetInputPrompt(String inputPrompt)Deprecated.Sets the input prompt - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input.protected voidsetInternalValue(String newValue)Deprecated.Sets the internal field value.voidsetMaxLength(int maxLength)Deprecated.Sets the maximum number of characters in the field.voidsetNullRepresentation(String nullRepresentation)Deprecated.Sets the null-string representation.voidsetNullSettingAllowed(boolean nullSettingAllowed)Deprecated.Sets the null conversion mode.voidsetSelectionRange(int pos, int length)Deprecated.Sets the range of text to be selected.voidsetTextChangeEventMode(AbstractTextField.TextChangeEventMode inputEventMode)Deprecated.Sets the mode how the TextField triggersFieldEvents.TextChangeEvents.voidsetTextChangeTimeout(int timeout)Deprecated.The text change timeout modifies how often text change events are communicated to the application whengetTextChangeEventMode()isAbstractTextField.TextChangeEventMode.LAZYorAbstractTextField.TextChangeEventMode.TIMEOUT.voidsetValue(String newValue)Deprecated.Sets the value of the field.voidwriteDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.-
Methods inherited from class com.vaadin.v7.ui.AbstractField
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, attach, clear, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getTabIndex, getValidators, getValue, isBuffered, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, shouldHideErrors, validate, validate, valueChange
-
Methods inherited from class com.vaadin.v7.ui.AbstractLegacyComponent
getExplicitImmediateValue, isImmediate, setImmediate
-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier
addShortcutListener, removeShortcutListener
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
-
Methods inherited from interface com.vaadin.ui.LegacyComponent
markAsDirty
-
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Methods inherited from interface com.vaadin.server.VariableOwner
isEnabled
-
-
-
-
Method Detail
-
getState
protected AbstractTextFieldState getState()
Deprecated.- Overrides:
getStatein classAbstractField<String>
-
getState
protected AbstractTextFieldState getState(boolean markAsDirty)
Deprecated.- Overrides:
getStatein classAbstractField<String>
-
beforeClientResponse
public void beforeClientResponse(boolean initial)
Deprecated.- Specified by:
beforeClientResponsein interfaceClientConnector- Overrides:
beforeClientResponsein classAbstractField<String>
-
paintContent
public void paintContent(PaintTarget target) throws PaintException
Deprecated.- Specified by:
paintContentin interfaceLegacyComponent- Throws:
PaintException
-
changeVariables
public void changeVariables(Object source, Map<String,Object> variables)
Deprecated.- Specified by:
changeVariablesin interfaceVariableOwner
-
getType
public Class<String> getType()
Deprecated.Description copied from class:AbstractFieldReturns the type of the Field. The methodsgetValueandsetValuemust be compatible with this type: one must be able to safely cast the value returned fromgetValueto the given type and pass any variable assignable to this type as an argument tosetValue.
-
getNullRepresentation
public String getNullRepresentation()
Deprecated.Gets the null-string representation.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'.
- Returns:
- the String Textual representation for null strings.
- See Also:
isNullSettingAllowed()
-
isNullSettingAllowed
public boolean isNullSettingAllowed()
Deprecated.Is setting nulls with null-string representation allowed.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
- Returns:
- boolean Should the null-string represenation be always converted to null-values.
- See Also:
getNullRepresentation()
-
setNullRepresentation
public void setNullRepresentation(String nullRepresentation)
Deprecated.Sets the null-string representation.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'
- Parameters:
nullRepresentation- Textual representation for null strings.- See Also:
setNullSettingAllowed(boolean)
-
setNullSettingAllowed
public void setNullSettingAllowed(boolean nullSettingAllowed)
Deprecated.Sets the null conversion mode.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.
- Parameters:
nullSettingAllowed- Should the null-string representation always be converted to null-values.- See Also:
getNullRepresentation()
-
isEmpty
public boolean isEmpty()
Deprecated.Description copied from interface:FieldIs the field empty? In general, "empty" state is same as null. As an exception, TextField also treats empty string as "empty".
-
getMaxLength
public int getMaxLength()
Deprecated.Returns the maximum number of characters in the field. Value -1 is considered unlimited. Terminal may however have some technical limits.- Returns:
- the maxLength
-
setMaxLength
public void setMaxLength(int maxLength)
Deprecated.Sets the maximum number of characters in the field. Value -1 is considered unlimited. Terminal may however have some technical limits.- Parameters:
maxLength- the maxLength to set
-
getColumns
public int getColumns()
Deprecated.Gets the number of columns in the editor. If the number of columns is set 0, the actual number of displayed columns is determined implicitly by the adapter.- Returns:
- the number of columns in the editor.
-
setColumns
public void setColumns(int columns)
Deprecated.Sets the number of columns in the editor. If the number of columns is set 0, the actual number of displayed columns is determined implicitly by the adapter.- Parameters:
columns- the number of columns to set.
-
getInputPrompt
public String getInputPrompt()
Deprecated.Gets the current input prompt.- Returns:
- the current input prompt, or null if not enabled
- See Also:
setInputPrompt(String)
-
setInputPrompt
public void setInputPrompt(String inputPrompt)
Deprecated.Sets the input prompt - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input.- Parameters:
inputPrompt-
-
setInternalValue
protected void setInternalValue(String newValue)
Deprecated.Description copied from class:AbstractFieldSets the internal field value. This is purely used by AbstractField to change the internal Field value. It does not trigger valuechange events. It can be overridden by the inheriting classes to update all dependent variables. Subclasses can also overrideAbstractField.getInternalValue()if necessary.- Overrides:
setInternalValuein classAbstractField<String>- Parameters:
newValue- the new value to be set.
-
setValue
public void setValue(String newValue) throws Property.ReadOnlyException
Deprecated.Description copied from class:AbstractFieldSets the value of the field.- Specified by:
setValuein interfaceProperty<String>- Overrides:
setValuein classAbstractField<String>- Parameters:
newValue- the New value of the field.- Throws:
Property.ReadOnlyException- if the object is in read-only mode
-
setTextChangeEventMode
public void setTextChangeEventMode(AbstractTextField.TextChangeEventMode inputEventMode)
Deprecated.Sets the mode how the TextField triggersFieldEvents.TextChangeEvents.- Parameters:
inputEventMode- the new mode- See Also:
AbstractTextField.TextChangeEventMode
-
getTextChangeEventMode
public AbstractTextField.TextChangeEventMode getTextChangeEventMode()
Deprecated.- Returns:
- the mode used to trigger
FieldEvents.TextChangeEvents.
-
addTextChangeListener
public void addTextChangeListener(FieldEvents.TextChangeListener listener)
Deprecated.- Specified by:
addTextChangeListenerin interfaceFieldEvents.TextChangeNotifier
-
addListener
@Deprecated public void addListener(FieldEvents.TextChangeListener listener)
Deprecated.As of 7.0, replaced byaddTextChangeListener(TextChangeListener)
-
removeTextChangeListener
public void removeTextChangeListener(FieldEvents.TextChangeListener listener)
Deprecated.- Specified by:
removeTextChangeListenerin interfaceFieldEvents.TextChangeNotifier
-
removeListener
@Deprecated public void removeListener(FieldEvents.TextChangeListener listener)
Deprecated.As of 7.0, replaced byremoveTextChangeListener(TextChangeListener)
-
setTextChangeTimeout
public void setTextChangeTimeout(int timeout)
Deprecated.The text change timeout modifies how often text change events are communicated to the application whengetTextChangeEventMode()isAbstractTextField.TextChangeEventMode.LAZYorAbstractTextField.TextChangeEventMode.TIMEOUT.- Parameters:
timeout- the timeout in milliseconds- See Also:
getTextChangeEventMode()
-
getTextChangeTimeout
public int getTextChangeTimeout()
Deprecated.Gets the timeout used to fireFieldEvents.TextChangeEvents when thegetTextChangeEventMode()isAbstractTextField.TextChangeEventMode.LAZYorAbstractTextField.TextChangeEventMode.TIMEOUT.- Returns:
- the timeout value in milliseconds
-
selectAll
public void selectAll()
Deprecated.Selects all text in the field.- Since:
- 6.4
-
setSelectionRange
public void setSelectionRange(int pos, int length)Deprecated.Sets the range of text to be selected. As a side effect the field will become focused.- Parameters:
pos- the position of the first character to be selectedlength- the number of characters to be selected- Since:
- 6.4
-
setCursorPosition
public void setCursorPosition(int pos)
Deprecated.Sets the cursor position in the field. As a side effect the field will become focused.- Parameters:
pos- the position for the cursor- Since:
- 6.4
-
getCursorPosition
public int getCursorPosition()
Deprecated.Returns the last known cursor position of the field.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
Field.ValueChangeEvents andFieldEvents.TextChangeEvents. This may change later if a deep push integration is built to Vaadin.- Returns:
- the cursor position
-
addFocusListener
public void addFocusListener(FieldEvents.FocusListener listener)
Deprecated.Description copied from interface:FieldEvents.FocusNotifierAdds aFocusListenerto the Component which gets fired when aFieldreceives keyboard focus.- Specified by:
addFocusListenerin interfaceFieldEvents.FocusNotifier- See Also:
FieldEvents.FocusListener
-
addListener
@Deprecated public void addListener(FieldEvents.FocusListener listener)
Deprecated.As of 7.0, replaced byaddFocusListener(FocusListener)
-
removeFocusListener
public void removeFocusListener(FieldEvents.FocusListener listener)
Deprecated.Description copied from interface:FieldEvents.FocusNotifierRemoves aFocusListenerfrom the Component.- Specified by:
removeFocusListenerin interfaceFieldEvents.FocusNotifier- See Also:
FieldEvents.FocusListener
-
removeListener
@Deprecated public void removeListener(FieldEvents.FocusListener listener)
Deprecated.As of 7.0, replaced byremoveFocusListener(FocusListener)
-
addBlurListener
public void addBlurListener(FieldEvents.BlurListener listener)
Deprecated.Description copied from interface:FieldEvents.BlurNotifierAdds aBlurListenerto the Component which gets fired when aFieldloses keyboard focus.- Specified by:
addBlurListenerin interfaceFieldEvents.BlurNotifier- See Also:
FieldEvents.BlurListener
-
addListener
@Deprecated public void addListener(FieldEvents.BlurListener listener)
Deprecated.As of 7.0, replaced byaddBlurListener(BlurListener)
-
removeBlurListener
public void removeBlurListener(FieldEvents.BlurListener listener)
Deprecated.Description copied from interface:FieldEvents.BlurNotifierRemoves aBlurListenerfrom the Component.- Specified by:
removeBlurListenerin interfaceFieldEvents.BlurNotifier- See Also:
FieldEvents.BlurListener
-
removeListener
@Deprecated public void removeListener(FieldEvents.BlurListener listener)
Deprecated.As of 7.0, replaced byremoveBlurListener(BlurListener)
-
readDesign
public void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.- Specified by:
readDesignin interfaceComponent- Overrides:
readDesignin classAbstractField<String>
-
getCustomAttributes
protected Collection<String> getCustomAttributes()
Deprecated.- Overrides:
getCustomAttributesin classAbstractField<String>
-
writeDesign
public void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.- Specified by:
writeDesignin interfaceComponent- Overrides:
writeDesignin classAbstractField<String>
-
-