|
||||||||||
| 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
com.vaadin.ui.AbstractTextField
com.vaadin.ui.TextField
public class TextField
A text editor component that can be bound to any bindable Property. The text editor supports both multiline and single line modes, default is one-line mode.
Since TextField extends AbstractField it implements
the Buffered interface. A TextField is
in write-through mode by default, so
AbstractField.setWriteThrough(boolean) must be called
to enable buffering.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.vaadin.ui.AbstractTextField |
|---|
AbstractTextField.TextChangeEventImpl, AbstractTextField.TextChangeEventMode |
| 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.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.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
| Constructor Summary | |
|---|---|
TextField()
Constructs an empty TextField with no caption. |
|
TextField(Property dataSource)
Constructs a new TextField that's bound to the specified
Property and has no caption. |
|
TextField(String caption)
Constructs an empty TextField with given caption. |
|
TextField(String caption,
Property dataSource)
Constructs a new TextField that's bound to the specified
Property and has the given caption String. |
|
TextField(String caption,
String value)
Constructs a new TextField with the given caption and
initial text contents. |
|
| Method Summary | |
|---|---|
int |
getRows()
Deprecated. Starting from 6.5 use TextArea for a multi-line text
input. |
boolean |
isSecret()
Deprecated. Starting from 6.5 use PasswordField instead for
secret text input. |
boolean |
isWordwrap()
Deprecated. Starting from 6.5 use TextArea for a multi-line text
input. |
void |
paintContent(PaintTarget target)
Paints any needed component-specific things to the given UIDL stream. |
void |
setHeight(float height,
int unit)
Sets the height of the TextField instance. |
void |
setHeight(String height)
Sets the height of the TextField instance. |
void |
setRows(int rows)
Deprecated. Starting from 6.5 use TextArea for a multi-line text
input. |
void |
setSecret(boolean secret)
Deprecated. Starting from 6.5 use PasswordField instead for
secret text input. |
void |
setWordwrap(boolean wordwrap)
Deprecated. Starting from 6.5 use TextArea for a multi-line text
input. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.vaadin.ui.Field |
|---|
getDescription, setCaption, setDescription |
| Constructor Detail |
|---|
public TextField()
TextField with no caption.
public TextField(String caption)
TextField with given caption.
caption - the caption String for the editor.public TextField(Property dataSource)
TextField that's bound to the specified
Property and has no caption.
dataSource - the Property to be edited with this editor.
public TextField(String caption,
Property dataSource)
TextField that's bound to the specified
Property and has the given caption String.
caption - the caption String for the editor.dataSource - the Property to be edited with this editor.
public TextField(String caption,
String value)
TextField with the given caption and
initial text contents. The editor constructed this way will not be bound
to a Property unless
Property.Viewer.setPropertyDataSource(Property)
is called to bind it.
caption - the caption String for the editor.text - the initial text content of the editor.| Method Detail |
|---|
@Deprecated public boolean isSecret()
PasswordField instead for
secret text input.
true if the field is used to enter secret
information, false otherwise.@Deprecated public void setSecret(boolean secret)
PasswordField instead for
secret text input.
secret - the value specifying if the field is used to enter secret
information.
public void paintContent(PaintTarget target)
throws PaintException
AbstractComponentAbstractComponent.paint(PaintTarget) method handles all general
attributes common to all components, and it calls this method to paint
any component-specific attributes to the UIDL stream.
paintContent in class AbstractTextFieldtarget - the target UIDL stream where the component should paint itself
to
PaintException - if the paint operation failed.@Deprecated public int getRows()
TextArea for a multi-line text
input.
@Deprecated public void setRows(int rows)
TextArea for a multi-line text
input.
rows - the number of rows for this editor.@Deprecated public boolean isWordwrap()
TextArea for a multi-line text
input.
true if the component is in the word-wrap mode,
false if not.@Deprecated public void setWordwrap(boolean wordwrap)
TextArea for a multi-line text
input.
wordwrap - the boolean value specifying if the editor should be in
word-wrap mode after the call or not.
public void setHeight(float height,
int unit)
TextField instance.
Setting height for TextField also has a side-effect that puts
TextField into multiline mode (aka "textarea"). Multiline mode
can also be achieved by calling setRows(int). The height value
overrides the number of rows set by setRows(int).
If you want to set height of single line TextField, call
setRows(int) with value 0 after setting the height. Setting rows
to 0 resets the side-effect.
Starting from 6.5 you should use TextArea instead of
TextField for multiline text input.
setHeight in interface SizeablesetHeight in class AbstractComponentheight - the height of the object.unit - the unit used for the width. Possible values include
Sizeable.UNITS_PIXELS, Sizeable.UNITS_POINTS,
Sizeable.UNITS_PICAS, Sizeable.UNITS_EM, Sizeable.UNITS_EX,
Sizeable.UNITS_MM, Sizeable.UNITS_CM, Sizeable.UNITS_INCH,
Sizeable.UNITS_PERCENTAGE.AbstractComponent.setHeight(float, int)public void setHeight(String height)
TextField instance.
Setting height for TextField also has a side-effect that puts
TextField into multiline mode (aka "textarea"). Multiline mode
can also be achieved by calling setRows(int). The height value
overrides the number of rows set by setRows(int).
If you want to set height of single line TextField, call
setRows(int) with value 0 after setting the height. Setting rows
to 0 resets the side-effect.
setHeight in interface SizeablesetHeight in class AbstractComponentheight - in CSS style string representationAbstractComponent.setHeight(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||