|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itmill.toolkit.terminal.Identifiable
com.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.ui.AbstractField
com.itmill.toolkit.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.itmill.toolkit.ui.AbstractField |
|---|
AbstractField.ReadOnlyStatusChangeEvent |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Field |
|---|
Field.ValueChangeEvent |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Component |
|---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Buffered |
|---|
Buffered.SourceException |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.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 | |
|---|---|
void |
changeVariables(Object source,
Map variables)
Called when one or more variables handled by the implementing class are changed. |
int |
getColumns()
Gets the number of columns in the editor. |
Format |
getFormat()
Gets the value formatter of TextField. |
protected String |
getFormattedValue()
Gets the formatted string value. |
int |
getMaxLength()
Gets the maximum number of characters allowed in this textfield. |
String |
getNullRepresentation()
Gets the null-string representation. |
int |
getRows()
Gets the number of rows in the editor. |
String |
getTag()
Gets the UIDL tag corresponding to the component. |
Class |
getType()
Returns the type of the Property. |
boolean |
isNullSettingAllowed()
Is setting nulls with null-string representation allowed. |
boolean |
isSecret()
Gets the secret property on and off. |
boolean |
isWordwrap()
Tests if the editor is in word-wrap mode. |
void |
paintContent(PaintTarget target)
Paints any needed component-specific things to the given UIDL stream. |
void |
setColumns(int columns)
Sets the number of columns in the editor. |
void |
setFormat(Format format)
Gets the value formatter of TextField. |
void |
setMaxLength(int maxlength)
Set maximum length of characters allowed in this textfield. |
void |
setNullRepresentation(String nullRepresentation)
Sets the null-string representation. |
void |
setNullSettingAllowed(boolean nullSettingAllowed)
Sets the null conversion mode. |
void |
setRows(int rows)
Sets the number of rows in the editor. |
void |
setSecret(boolean secret)
Sets the secret property on and off. |
void |
setWordwrap(boolean wordwrap)
Sets the editor's word-wrap mode on or off. |
| Methods inherited from class com.itmill.toolkit.ui.AbstractField |
|---|
addListener, addListener, addValidator, attach, commit, constructField, discard, finalize, fireReadOnlyStatusChange, fireValueChange, focus, getErrorMessage, getFocusableId, getPropertyDataSource, getTabIndex, getValidators, getValue, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isWriteThrough, removeListener, removeListener, removeValidator, setInternalValue, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setRequired, setTabIndex, setValue, setWriteThrough, toString, validate, valueChange |
| Methods inherited from class com.itmill.toolkit.ui.AbstractComponent |
|---|
addListener, addListener, addListener, addListener, childRequestedRepaint, dependsOn, detach, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDescription, getDirectDependencies, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible |
| Methods inherited from class com.itmill.toolkit.terminal.Identifiable |
|---|
getDebugId, getUIID, setDebugId, setUIID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.itmill.toolkit.ui.Field |
|---|
getDescription, setCaption, setDescription |
| Methods inherited from interface com.itmill.toolkit.ui.Component |
|---|
addListener, childRequestedRepaint, detach, getApplication, getCaption, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isVisible, removeListener, setEnabled, setParent, setStyle, setVisible |
| Methods inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
addListener, paint, removeListener, requestRepaint, requestRepaintRequests |
| Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner |
|---|
dependsOn, getDirectDependencies, isImmediate, removeDirectDependency |
| 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 |
|---|
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 AbstractFieldtarget - the target UIDL stream where the component should paint itself
to
PaintException - if the paint operation failed.protected String getFormattedValue()
setFormat(Format),
Formatpublic String getTag()
AbstractComponent
getTag in class AbstractComponentString
public void changeVariables(Object source,
Map variables)
VariableOwner
changeVariables in interface VariableOwnerchangeVariables in class AbstractComponentsource - 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 int getColumns()
public void setColumns(int columns)
columns - the number of columns to set.public int getRows()
public void setRows(int rows)
rows - the number of rows for this editor.public boolean isWordwrap()
true if the component is in the word-wrap mode,
false if not.public void setWordwrap(boolean wordwrap)
wordwrap - the boolean value specifying if the editor should be in
word-wrap mode after the call or not.public Class getType()
PropertygetValue 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 PropertygetType in class AbstractFieldpublic boolean isSecret()
true if the field is used to enter secret
information, false otherwise.public void setSecret(boolean secret)
secret - the value specifying if the field is used to enter secret
information.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 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
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 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.
nullSettingAllowed - Should the null-string represenation be allways converted to
null-values.getNullRepresentation()public Format getFormat()
public void setFormat(Format format)
format - the Format used to format the value. Null disables the
formatting.public int getMaxLength()
public void setMaxLength(int maxlength)
maxlength - The maximum number of characters allowed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||