@Deprecated public abstract class AbstractTextField extends AbstractField<String> implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, FieldEvents.TextChangeNotifier, LegacyComponent
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractTextField.TextChangeEventImpl
Deprecated.
|
static class |
AbstractTextField.TextChangeEventMode
Deprecated.
|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEventComponent.ErrorEvent, Component.Event, Component.Focusable, Component.ListenerClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListenerSizeable.UnitField.ValueChangeEventBuffered.SourceExceptionProperty.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.ViewerDESIGN_ATTR_PLAIN_TEXTSIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTextField()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBlurListener(FieldEvents.BlurListener listener)
Deprecated.
Adds a
BlurListener to the Component which gets fired
when a Field loses keyboard focus. |
void |
addFocusListener(FieldEvents.FocusListener listener)
Deprecated.
Adds a
FocusListener to the Component which gets fired
when a Field receives keyboard focus. |
void |
addListener(FieldEvents.BlurListener listener)
Deprecated.
As of 7.0, replaced by
#addBlurListener(BlurListener) |
void |
addListener(FieldEvents.FocusListener listener)
Deprecated.
As of 7.0, replaced by
#addFocusListener(FocusListener) |
void |
addListener(FieldEvents.TextChangeListener listener)
Deprecated.
As of 7.0, replaced by
#addTextChangeListener(TextChangeListener) |
void |
addTextChangeListener(FieldEvents.TextChangeListener listener)
Deprecated.
|
void |
beforeClientResponse(boolean initial)
Deprecated.
|
void |
changeVariables(Object source,
Map<String,Object> variables)
Deprecated.
|
int |
getColumns()
Deprecated.
Gets the number of columns in the editor.
|
int |
getCursorPosition()
Deprecated.
Returns the last known cursor position of the field.
|
protected Collection<String> |
getCustomAttributes()
Deprecated.
|
String |
getInputPrompt()
Deprecated.
Gets the current input prompt.
|
int |
getMaxLength()
Deprecated.
Returns the maximum number of characters in the field.
|
String |
getNullRepresentation()
Deprecated.
Gets the null-string representation.
|
protected AbstractTextFieldState |
getState()
Deprecated.
|
protected AbstractTextFieldState |
getState(boolean markAsDirty)
Deprecated.
|
AbstractTextField.TextChangeEventMode |
getTextChangeEventMode()
Deprecated.
|
int |
getTextChangeTimeout()
Deprecated.
Gets the timeout used to fire
FieldEvents.TextChangeEvents when the
getTextChangeEventMode() is AbstractTextField.TextChangeEventMode.LAZY or
AbstractTextField.TextChangeEventMode.TIMEOUT. |
Class<String> |
getType()
Deprecated.
Returns the type of the Field.
|
boolean |
isEmpty()
Deprecated.
Is the field empty?
In general, "empty" state is same as null.
|
boolean |
isNullSettingAllowed()
Deprecated.
Is setting nulls with null-string representation allowed.
|
void |
paintContent(PaintTarget target)
Deprecated.
|
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Deprecated.
|
void |
removeBlurListener(FieldEvents.BlurListener listener)
Deprecated.
Removes a
BlurListener from the Component. |
void |
removeFocusListener(FieldEvents.FocusListener listener)
Deprecated.
Removes a
FocusListener from the Component. |
void |
removeListener(FieldEvents.BlurListener listener)
Deprecated.
As of 7.0, replaced by
#removeBlurListener(BlurListener) |
void |
removeListener(FieldEvents.FocusListener listener)
Deprecated.
As of 7.0, replaced by
#removeFocusListener(FocusListener) |
void |
removeListener(FieldEvents.TextChangeListener listener)
Deprecated.
As of 7.0, replaced by
#removeTextChangeListener(TextChangeListener) |
void |
removeTextChangeListener(FieldEvents.TextChangeListener listener)
Deprecated.
|
void |
selectAll()
Deprecated.
Selects all text in the field.
|
void |
setColumns(int columns)
Deprecated.
Sets the number of columns in the editor.
|
void |
setCursorPosition(int pos)
Deprecated.
Sets the cursor position in the field.
|
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.
|
protected void |
setInternalValue(String newValue)
Deprecated.
Sets the internal field value.
|
void |
setMaxLength(int maxLength)
Deprecated.
Sets the maximum number of characters in the field.
|
void |
setNullRepresentation(String nullRepresentation)
Deprecated.
Sets the null-string representation.
|
void |
setNullSettingAllowed(boolean nullSettingAllowed)
Deprecated.
Sets the null conversion mode.
|
void |
setSelectionRange(int pos,
int length)
Deprecated.
Sets the range of text to be selected.
|
void |
setTextChangeEventMode(AbstractTextField.TextChangeEventMode inputEventMode)
Deprecated.
Sets the mode how the TextField triggers
FieldEvents.TextChangeEvents. |
void |
setTextChangeTimeout(int timeout)
Deprecated.
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(String newValue)
Deprecated.
Sets the value of the field.
|
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Deprecated.
|
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, valueChangegetExplicitImmediateValue, isImmediate, setImmediateaddContextClickListener, 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, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthUndefinedaddAttachListener, addDetachListener, addExtension, 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, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitmarkAsDirtyisEnabledaddListener, 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, setVisibleaddAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefinedaddShortcutListener, removeShortcutListenerprotected AbstractTextFieldState getState()
getState in class AbstractField<String>protected AbstractTextFieldState getState(boolean markAsDirty)
getState in class AbstractField<String>public void beforeClientResponse(boolean initial)
beforeClientResponse in interface ClientConnectorbeforeClientResponse in class AbstractField<String>public void paintContent(PaintTarget target) throws PaintException
paintContent in interface LegacyComponentPaintExceptionpublic void changeVariables(Object source, Map<String,Object> variables)
changeVariables in interface VariableOwnerpublic 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.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()public boolean isEmpty()
Fieldpublic 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(String newValue) throws Property.ReadOnlyException
AbstractFieldsetValue 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 addTextChangeListener(FieldEvents.TextChangeListener listener)
addTextChangeListener in interface FieldEvents.TextChangeNotifier@Deprecated public void addListener(FieldEvents.TextChangeListener listener)
#addTextChangeListener(TextChangeListener)public void removeTextChangeListener(FieldEvents.TextChangeListener listener)
removeTextChangeListener in interface FieldEvents.TextChangeNotifier@Deprecated public void removeListener(FieldEvents.TextChangeListener listener)
#removeTextChangeListener(TextChangeListener)public 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 addFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifierFocusListener to the Component which gets fired
when a Field receives keyboard focus.addFocusListener in interface FieldEvents.FocusNotifierFieldEvents.FocusListener@Deprecated public void addListener(FieldEvents.FocusListener listener)
#addFocusListener(FocusListener)public void removeFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifierFocusListener from the Component.removeFocusListener in interface FieldEvents.FocusNotifierFieldEvents.FocusListener@Deprecated public void removeListener(FieldEvents.FocusListener listener)
#removeFocusListener(FocusListener)public void addBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifierBlurListener to the Component which gets fired
when a Field loses keyboard focus.addBlurListener in interface FieldEvents.BlurNotifierFieldEvents.BlurListener@Deprecated public void addListener(FieldEvents.BlurListener listener)
#addBlurListener(BlurListener)public void removeBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifierBlurListener from the Component.removeBlurListener in interface FieldEvents.BlurNotifierFieldEvents.BlurListener@Deprecated public void removeListener(FieldEvents.BlurListener listener)
#removeBlurListener(BlurListener)public void readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
readDesign in interface ComponentreadDesign in class AbstractField<String>protected Collection<String> getCustomAttributes()
getCustomAttributes in class AbstractField<String>public void writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
writeDesign in interface ComponentwriteDesign in class AbstractField<String>Copyright © 2019 Vaadin Ltd. All rights reserved.