|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<java.lang.String>
com.vaadin.ui.AbstractTextField
public abstract class AbstractTextField
Nested Class Summary | |
---|---|
static class |
AbstractTextField.TextChangeEventImpl
|
static class |
AbstractTextField.TextChangeEventMode
Different modes how the TextField can trigger FieldEvents.TextChangeEvent s. |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
---|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent |
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.server.ClientConnector |
---|
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.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.server.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 |
addBlurListener(FieldEvents.BlurListener listener)
Adds a BlurListener to the Component which gets fired
when a Field loses keyboard focus. |
void |
addFocusListener(FieldEvents.FocusListener listener)
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)
|
void |
beforeClientResponse(boolean initial)
Called before the shared state and RPC invocations are sent to the client. |
void |
changeVariables(java.lang.Object source,
java.util.Map<java.lang.String,java.lang.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. |
java.lang.String |
getInputPrompt()
Gets the current input prompt. |
int |
getMaxLength()
Returns the maximum number of characters in the field. |
java.lang.String |
getNullRepresentation()
Gets the null-string representation. |
protected com.vaadin.shared.ui.textfield.AbstractTextFieldState |
getState()
Returns the shared state bean with information to be sent from the server to the client. |
AbstractTextField.TextChangeEventMode |
getTextChangeEventMode()
|
int |
getTextChangeTimeout()
Gets the timeout used to fire FieldEvents.TextChangeEvent s when the
getTextChangeEventMode() is AbstractTextField.TextChangeEventMode.LAZY or
AbstractTextField.TextChangeEventMode.TIMEOUT . |
java.lang.Class<java.lang.String> |
getType()
Returns the type 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 |
removeBlurListener(FieldEvents.BlurListener listener)
Removes a BlurListener from the Component. |
void |
removeFocusListener(FieldEvents.FocusListener listener)
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)
|
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 |
setInputPrompt(java.lang.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(java.lang.String newValue)
Sets the internal field value. |
void |
setMaxLength(int maxLength)
Sets the maximum number of characters in the field. |
void |
setNullRepresentation(java.lang.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.TextChangeEvent s. |
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(java.lang.String 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.ui.LegacyComponent |
---|
markAsDirty |
Methods inherited from interface com.vaadin.server.VariableOwner |
---|
isEnabled, isImmediate |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
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.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.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 |
---|
protected com.vaadin.shared.ui.textfield.AbstractTextFieldState getState()
AbstractComponent
getState
in class AbstractField<java.lang.String>
public void beforeClientResponse(boolean initial)
ClientConnector
This method must not alter the component hierarchy in any way. Calling
ClientConnector.markAsDirty()
from this method will have no effect.
beforeClientResponse
in interface ClientConnector
beforeClientResponse
in class AbstractField<java.lang.String>
initial
- true
if the client-side connector will be created
and initialized after this method has been invoked.
false
if there is already an initialized
client-side connector.public void paintContent(PaintTarget target) throws PaintException
LegacyComponent
Paints 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 LegacyComponent
target
- the target UIDL stream where the component should paint itself
to.
PaintException
- if the paint operation failed.public void changeVariables(java.lang.Object source, java.util.Map<java.lang.String,java.lang.Object> variables)
VariableOwner
changeVariables
in interface VariableOwner
source
- 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 java.lang.Class<java.lang.String> getType()
AbstractField
getValue
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<java.lang.String>
getType
in class AbstractField<java.lang.String>
public java.lang.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(java.lang.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()
protected boolean isEmpty()
AbstractField
isEmpty
in class AbstractField<java.lang.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 java.lang.String getInputPrompt()
setInputPrompt(String)
public void setInputPrompt(java.lang.String inputPrompt)
inputPrompt
- protected void setInternalValue(java.lang.String newValue)
AbstractField
AbstractField.getInternalValue()
if necessary.
setInternalValue
in class AbstractField<java.lang.String>
newValue
- the new value to be set.public void setValue(java.lang.String newValue) throws Property.ReadOnlyException
AbstractField
setValue
in interface Property<java.lang.String>
setValue
in class AbstractField<java.lang.String>
newValue
- the New value of the field.
Property.ReadOnlyException
- if the object is in read-only modepublic void setTextChangeEventMode(AbstractTextField.TextChangeEventMode inputEventMode)
FieldEvents.TextChangeEvent
s.
inputEventMode
- the new modeAbstractTextField.TextChangeEventMode
public AbstractTextField.TextChangeEventMode getTextChangeEventMode()
FieldEvents.TextChangeEvent
s.public void addTextChangeListener(FieldEvents.TextChangeListener listener)
addTextChangeListener
in interface FieldEvents.TextChangeNotifier
@Deprecated public void addListener(FieldEvents.TextChangeListener listener)
#addTextChangeListener(TextChangeListener)
addListener
in interface FieldEvents.TextChangeNotifier
public void removeTextChangeListener(FieldEvents.TextChangeListener listener)
removeTextChangeListener
in interface FieldEvents.TextChangeNotifier
@Deprecated public void removeListener(FieldEvents.TextChangeListener listener)
#removeTextChangeListener(TextChangeListener)
removeListener
in interface FieldEvents.TextChangeNotifier
public void setTextChangeTimeout(int timeout)
getTextChangeEventMode()
is
AbstractTextField.TextChangeEventMode.LAZY
or AbstractTextField.TextChangeEventMode.TIMEOUT
.
timeout
- the timeout in millisecondsgetTextChangeEventMode()
public int getTextChangeTimeout()
FieldEvents.TextChangeEvent
s 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 ValueChangeEvent
s and FieldEvents.TextChangeEvent
s. This may change later if a deep push integration is built to Vaadin.
public void addFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifier
FocusListener
to the Component which gets fired
when a Field
receives keyboard focus.
addFocusListener
in interface FieldEvents.FocusNotifier
FieldEvents.FocusListener
@Deprecated public void addListener(FieldEvents.FocusListener listener)
#addFocusListener(FocusListener)
addListener
in interface FieldEvents.FocusNotifier
public void removeFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifier
FocusListener
from the Component.
removeFocusListener
in interface FieldEvents.FocusNotifier
FieldEvents.FocusListener
@Deprecated public void removeListener(FieldEvents.FocusListener listener)
#removeFocusListener(FocusListener)
removeListener
in interface FieldEvents.FocusNotifier
public void addBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifier
BlurListener
to the Component which gets fired
when a Field
loses keyboard focus.
addBlurListener
in interface FieldEvents.BlurNotifier
FieldEvents.BlurListener
@Deprecated public void addListener(FieldEvents.BlurListener listener)
#addBlurListener(BlurListener)
addListener
in interface FieldEvents.BlurNotifier
public void removeBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifier
BlurListener
from the Component.
removeBlurListener
in interface FieldEvents.BlurNotifier
FieldEvents.BlurListener
@Deprecated public void removeListener(FieldEvents.BlurListener listener)
#removeBlurListener(BlurListener)
removeListener
in interface FieldEvents.BlurNotifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |