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 com.itmill.toolkit.data.Buffered interface. A TextField is in write-through mode by default, so com.itmill.toolkit.ui.AbstractField must be called to enable buffering.

TextField()

Constructs an empty TextField with no caption.

TextField(Property)

Parameters

dataSource

the Property to be edited with this editor

Constructs a new TextField that's bound to the specified Property and has no caption.

TextField(String)

Constructs an empty TextField with given caption.

TextField(String, Property)

Parameters

caption

caption String for the editor

dataSource

the Property to be edited with this editor

Constructs a new TextField that's bound to the specified Property and has the given caption String .

TextField(String, String)

Parameters

caption

caption String for the editor

text

initial text content of the editor

Constructs a new TextField with the given caption and initial text contents. The editor constructed this way will not be bound to a Property unless setPropertyDataSource(com.itmill.toolkit.data.Property) is called to bind it.

getColumns()

Parameters

the

number of columns for this editor

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.

getFormat()

Parameters

return

The Format used to format the value.

Get the value formatter of TextField.

getNullRepresentation()

Parameters

return

String Textual representation for null strings.

Get 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'

getRows()

Parameters

return

number of explicitly set rows

Gets the number of rows in the editor. If the number of rows is set to 0, the actual number of displayed rows is determined implicitly by the adapter.

isNullSettingAllowed()

Parameters

return

boolean Should the null-string represenation be allways converted to null-values.

Is setting nulls with null-string representation allowed.

If this property is true, writing null-representation string to text field allways 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

isSecret()

Parameters

return

true if the field is used to enter secret information, false otherwise.

Get the secret property on and off. If a field is used to enter secretinformation the information is not echoed to display.

isWordwrap()

Parameters

return

true if the component is in the word-wrap mode, false if not

Tests if the editor is in word-wrap mode.

setColumns(int)

Parameters

return

number of explicitly set columns

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.

setFormat(Format)

Parameters

The

Format used to format the value. Null disables the formatting.

Get the value formatter of TextField.

setNullRepresentation(String)

Parameters

nullRepresentation

Textual representation for null strings.

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'

setNullSettingAllowed(boolean)

Parameters

nullSettingAllowed

Should the null-string represenation be allways converted to null-values.

Set the null conversion mode.

If this property is true, writing null-representation string to text field allways 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

setRows(int)

Parameters

the

number of rows for this editor

Sets the number of rows in the editor. If the number of rows is set to 0, the actual number of displayed rows is determined implicitly by the adapter.

setSecret(boolean)

Parameters

secret

value specifying if the field is used to enter secret information.

Set the secret property on and off. If a field is used to enter secretinformation the information is not echoed to display.

setWordwrap(boolean)

Parameters

wordwrap

boolean value specifying if the editor should be in word-wrap mode after the call or not.

Sets the editor's word-wrap mode on or off.