| |
|
| java.lang.Object org.millstone.base.ui.AbstractComponent org.millstone.base.ui.AbstractField
All known Subclasses: org.millstone.base.ui.TextField, org.millstone.base.ui.Form, org.millstone.base.ui.Select, org.millstone.base.ui.DateField, org.millstone.base.ui.Button,
AbstractField | public AbstractField()(Code) | | |
addValidator | public void addValidator(Validator validator)(Code) | | Adds a new validator for the field's value. All validators added to a
field are checked each time the its value changes.
Parameters: validator - the new validator to be added |
constructField | public static AbstractField constructField(Class propertyType)(Code) | | Create abstract field by the type of the property.
This returns most suitable field type for editing property of given type
Parameters: propertyType - Type of the property, that needs to be edited. |
fireReadOnlyStatusChange | protected void fireReadOnlyStatusChange()(Code) | | Emit a read-only status change event. The value contained in the field is
validated before the event is created.
|
fireValueChange | protected void fireValueChange()(Code) | | Emit a value change event. The value contained in the field is validated
before the event is created.
|
focus | public void focus()(Code) | | Ask the terminal to place the cursor to this field.
|
getFocusableId | public long getFocusableId()(Code) | | See Also: org.millstone.base.ui.Component.Focusable.getFocusableId |
getPropertyDataSource | public Property getPropertyDataSource()(Code) | | Gets the current data source of the field, if any.
The current data source as a Property, or null ifnone defined. |
getTabIndex | public int getTabIndex()(Code) | | Get the tab index of this field. The tab index property is used to
specify the natural tab ordering of fields.
Tab index of this field. Negative value means unspecified. |
getValidators | public Collection getValidators()(Code) | | Gets the validators of the field.
Unmodifiable collection that holds all validators for the field. |
getValue | public Object getValue()(Code) | | Gets the current value of the field. This is the visible, modified and
possible invalid value the user have entered to the field. In the
read-through mode, the abstract buffer is also updated and validation is
performed.
the current value of the field |
isInvalidAllowed | public boolean isInvalidAllowed()(Code) | | Fields allow invalid values by default. In most cases this is wanted,
because the field otherwise visually forget the user input immediately.
See Also: org.millstone.base.data.Validatable.isInvalidAllowed true iff the invalid values are allowed. |
isInvalidCommitted | public boolean isInvalidCommitted()(Code) | | |
isModified | public boolean isModified()(Code) | | |
isReadOnly | public boolean isReadOnly()(Code) | | The abstract field is read only also if the data source is in readonly
mode.
|
isReadThrough | public boolean isReadThrough()(Code) | | |
isRequired | public boolean isRequired()(Code) | | Is this field required.
Required fields must filled by the user.
true if the |
isValid | public boolean isValid()(Code) | | Tests the current value against all registered validators.
true if all registered validators claim that thecurrent value is valid, false otherwise |
isWriteThrough | public boolean isWriteThrough()(Code) | | |
removeValidator | public void removeValidator(Validator validator)(Code) | | Removes a validator from the field.
Parameters: validator - the validator to remove |
setInternalValue | protected void setInternalValue(Object newValue)(Code) | | Set the internal field value. This is purely used by AbstractField to
change the internal Field value. It does not trigger any events. It can
be overriden by the inheriting classes to update all dependent variables.
Parameters: newValue - The new value to be set. |
setInvalidAllowed | public void setInvalidAllowed(boolean invalidAllowed) throws UnsupportedOperationException(Code) | | Fields allow invalid values by default. In most cases this is wanted,
because the field otherwise visually forget the user input immediately.
In common setting where the user wants to assure the correctness of the
datasource, but allow temporarily invalid contents in the field, the user
should add the validators to datasource, that should not allow invalid
values. The validators are automatically copied to the field when the
datasource is set.
See Also: org.millstone.base.data.Validatable.setInvalidAllowed(boolean) |
setInvalidCommitted | public void setInvalidCommitted(boolean isCommitted)(Code) | | |
setPropertyDataSource | public void setPropertyDataSource(Property newDataSource)(Code) | |
Sets the specified Property as the data source for the field. All
uncommitted changes to the field are discarded and the value is refreshed
from the new data source.
If the datasource has any validators, the same validators are added to
the field. Because the default behavior of the field is to allow invalid
values, but not to allow committing them, this only adds visual error
messages to fields and do not allow committing them as long as the value
is invalid. After the value is valid, the error message is not shown and
the commit can be done normally.
Parameters: newDataSource - the new data source Property |
setRequired | public void setRequired(boolean required)(Code) | | Set the field required. Required fields must filled by the user.
Parameters: required - Is the field required |
setTabIndex | public void setTabIndex(int tabIndex)(Code) | | Get the tab index of this field. The tab index property is used to
specify the natural tab ordering of fields.
Parameters: tabIndex - The tab order of this component. Negative value meansunspecified. |
toString | public String toString()(Code) | | Returns the value of the Property in human readable textual format.
String representation of the value stored in theProperty |
valueChange | public void valueChange(Property.ValueChangeEvent event)(Code) | | This method listens to data source value changes and passes the changes
forwards.
Parameters: event - the value change event telling the data source contents havechanged |
Methods inherited from org.millstone.base.ui.AbstractComponent | public void addListener(RepaintRequestListener listener)(Code)(Java Doc) public void addListener(Class eventType, Object object, Method method)(Code)(Java Doc) public void addListener(Class eventType, Object object, String methodName)(Code)(Java Doc) public void addListener(Component.Listener listener)(Code)(Java Doc) public void attach()(Code)(Java Doc) public void changeVariables(Object source, Map variables)(Code)(Java Doc) public void childRequestedRepaint(Collection alreadyNotified)(Code)(Java Doc) public void dependsOn(VariableOwner depended)(Code)(Java Doc) public void detach()(Code)(Java Doc) protected void fireComponentErrorEvent()(Code)(Java Doc) protected void fireComponentEvent()(Code)(Java Doc) protected void fireEvent(Component.Event event)(Code)(Java Doc) public Application getApplication()(Code)(Java Doc) public String getCaption()(Code)(Java Doc) public ErrorMessage getComponentError()(Code)(Java Doc) public Object getData()(Code)(Java Doc) public String getDescription()(Code)(Java Doc) public Set getDirectDependencies()(Code)(Java Doc) public ErrorMessage getErrorMessage()(Code)(Java Doc) public Resource getIcon()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public Component getParent()(Code)(Java Doc) public String getStyle()(Code)(Java Doc) abstract public String getTag()(Code)(Java Doc) public Window getWindow()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isImmediate()(Code)(Java Doc) public boolean isReadOnly()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) final public void paint(PaintTarget target) throws PaintException(Code)(Java Doc) public void paintContent(PaintTarget target) throws PaintException(Code)(Java Doc) public void removeDirectDependency(VariableOwner depended)(Code)(Java Doc) public void removeListener(RepaintRequestListener listener)(Code)(Java Doc) public void removeListener(Class eventType, Object target)(Code)(Java Doc) public void removeListener(Class eventType, Object target, Method method)(Code)(Java Doc) public void removeListener(Class eventType, Object target, String methodName)(Code)(Java Doc) public void removeListener(Component.Listener listener)(Code)(Java Doc) public void requestRepaint()(Code)(Java Doc) public void requestRepaintRequests()(Code)(Java Doc) public void setCaption(String caption)(Code)(Java Doc) public void setComponentError(ErrorMessage componentError)(Code)(Java Doc) public void setData(Object data)(Code)(Java Doc) public void setDescription(String description)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setIcon(Resource icon)(Code)(Java Doc) public void setImmediate(boolean immediate)(Code)(Java Doc) public void setLocale(Locale locale)(Code)(Java Doc) public void setParent(Component parent)(Code)(Java Doc) public void setReadOnly(boolean readOnly)(Code)(Java Doc) public void setStyle(String style)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc)
|
|
|
|