|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.millstone.base.ui.AbstractComponent
|
+--org.millstone.base.ui.AbstractField
|
+--org.millstone.base.ui.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 inherited from class org.millstone.base.ui.AbstractField |
AbstractField.ReadOnlyStatusChangeEvent, AbstractField.ValueChangeEvent |
| Nested classes inherited from class org.millstone.base.data.Buffered |
Buffered.SourceException |
| Nested classes inherited from class org.millstone.base.data.Property |
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeEvent, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
| Nested classes inherited from class org.millstone.base.ui.Component |
Component.Event, Component.Listener |
| Nested classes inherited from class org.millstone.base.terminal.Paintable |
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
| 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(java.lang.String caption)
Constructs an empty TextField with given caption. |
|
TextField(java.lang.String caption,
Property dataSource)
Constructs a new TextField that's bound to the
specified Property and has the given caption
String. |
|
TextField(java.lang.String caption,
java.lang.String value)
Constructs a new TextField with the given caption and
initial text contents. |
|
| Method Summary | |
void |
changeVariables(java.lang.Object source,
java.util.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. |
java.lang.String |
getNullRepresentation()
Get the null-string representation. |
int |
getRows()
Gets the number of rows in the editor. |
java.lang.String |
getTag()
Gets the UIDL tag corresponding to the component. |
java.lang.Class |
getType()
Returns the type of the Property. |
boolean |
isNullSettingAllowed()
Is setting nulls with null-string representation allowed. |
boolean |
isSecret()
Get 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 |
setNullRepresentation(java.lang.String nullRepresentation)
Sets the null-string representation. |
void |
setNullSettingAllowed(boolean nullSettingAllowed)
Set the null conversion mode. |
void |
setRows(int rows)
Sets the number of rows in the editor. |
void |
setSecret(boolean secret)
Set the secret property on and off. |
void |
setWordwrap(boolean wordwrap)
Sets the editor's word-wrap mode on or off. |
| Methods inherited from class org.millstone.base.ui.AbstractField |
addListener, addListener, addValidator, commit, constructField, discard, fireReadOnlyStatusChange, fireValueChange, focus, getErrorMessage, getPropertyDataSource, getValidators, getValue, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isValid, isWriteThrough, removeListener, removeListener, removeValidator, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setValue, setWriteThrough, toString, validate, valueChange |
| Methods inherited from class org.millstone.base.ui.AbstractComponent |
addListener, addListener, addListener, addListener, attach, childRequestedRepaint, dependsOn, detach, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getDescription, getDirectDependencies, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TextField()
TextField with no caption.
public TextField(java.lang.String caption)
TextField with given caption.
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(java.lang.String caption,
Property dataSource)
TextField that's bound to the
specified Property and has the given caption
String.
caption - caption String for the editordataSource - the Property to be edited with this editor
public TextField(java.lang.String caption,
java.lang.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 - caption String for 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 - target UIDL stream where the component should paint
itself to
PaintException - if the operation failedpublic java.lang.String getTag()
AbstractComponent
getTag in class AbstractComponentString
public void changeVariables(java.lang.Object source,
java.util.Map variables)
VariableOwner
changeVariables in interface VariableOwnerchangeVariables in class AbstractComponentsource - Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables - Mapping from variable names to new variable valuespublic int getColumns()
public void setColumns(int columns)
public int getRows()
public void setRows(int rows)
public boolean isWordwrap()
true if the component is in the word-wrap mode,
false if notpublic void setWordwrap(boolean wordwrap)
wordwrap - boolean value specifying if the editor should be in
word-wrap mode after the call or not.public java.lang.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()
public void setSecret(boolean secret)
secret - value specifying if the field is used to enter secret information.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 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(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 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||