|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PropertyComponent
Common interface for all editors in the UI. An editor is a component that is capable of editing a single property of a single javabean in a cluster of javabeans.
All PropertyComponent implementations must also have 2 constructors.
The contract for these 2 constructors is as follows :
A good design to implement this interface is to use the PropertyComponentSupport class. Create a protected instance of this support class inside your own class. In your constructors, instantiate based on the databinding (or no databinding for default constructor) an instance of this class, and implement all operations in this interface by delegating to the support object.
Method Summary | |
---|---|
void |
addValidator(Validator validator)
Add extra validators to this component. |
java.lang.Object |
getBean()
Retrieve the root bean this editor is bound to. |
java.lang.Class |
getBeanClass()
Determine the type of bean we are bound to. |
Decorator |
getDecorator()
Gets the decorator, if any is configured. |
java.lang.String |
getProperty()
Retrieve the property path to bind to on the domain model cluster. |
java.util.List |
getValidationErrors()
Retrieves a list of currently pending validation errors on this component. |
java.util.List |
getValidators()
Retrieve the list of active validators on this component. |
java.lang.Object |
getValue()
Retrieve the property value from the domain model cluster. |
boolean |
isMarkedInvalid()
|
boolean |
isReadOnly()
|
boolean |
isRequired()
Query if the editor is required to be filled in. |
boolean |
isValid()
Check if this component contains valid user input. |
void |
markInvalid()
Marks the component as invalid. |
void |
markValid()
Marks the component as valid (remove error marking) |
void |
preRender()
Make changes to the visual representation of this component before Echo starts rendering the component. |
void |
removeValidator(Validator validator)
Remove an existing validator from this component. |
void |
setBean(java.lang.Object bean)
sets the root bean for property-binding. |
void |
setBeanClass(java.lang.Class beanClass)
Change the type of model bean this property component will be bound to. |
void |
setDecorator(Decorator decorator)
Sets the decorator. |
void |
setProperty(java.lang.String propertyPath)
Set the property(path) to bind to on the domain model cluster. |
void |
setReadOnly(boolean readOnly)
Mark this component as read-only. |
void |
setRequired(boolean required)
Determine if the editor is required to be filled in. |
void |
setValue(java.lang.Object value)
Writes the supplied data into the property we are bound to. |
Method Detail |
---|
void setBean(java.lang.Object bean)
sets the root bean for property-binding.
java.lang.Object getBean()
Retrieve the root bean this editor is bound to.
java.lang.Class getBeanClass()
Determine the type of bean we are bound to.
During the lifecycle of a property component, this may NOT change ! In other words, if this component has been bound to, let's say, an Address object, this component must at all times remain bound to Address components ! (It may ofcourse change the specific instance to which it is bound, by calling setBean.)
void setBeanClass(java.lang.Class beanClass)
Change the type of model bean this property component will be bound to.
void setProperty(java.lang.String propertyPath)
Set the property(path) to bind to on the domain model cluster.
java.lang.String getProperty()
Retrieve the property path to bind to on the domain model cluster.
void setValue(java.lang.Object value)
Writes the supplied data into the property we are bound to.
java.lang.Object getValue()
Retrieve the property value from the domain model cluster.
boolean isRequired()
Query if the editor is required to be filled in.
void setRequired(boolean required)
Determine if the editor is required to be filled in.
void preRender()
Make changes to the visual representation of this component before Echo starts rendering the component.
Do not modify any bound javabeans in this method, as the changes to these will not be reflected properly on the screen.
Decorator getDecorator()
Gets the decorator, if any is configured.
void setDecorator(Decorator decorator)
Sets the decorator.
void setReadOnly(boolean readOnly)
Mark this component as read-only.
boolean isReadOnly()
boolean isValid()
Check if this component contains valid user input. In itself this
operation will not mark the component in error. In order to apply error
marking on invalid components you should use
EchoSupport.doValidationRecursively(Component)
.
void markValid()
Marks the component as valid (remove error marking)
void markInvalid()
Marks the component as invalid. Typically puts a colored border around it to indicate the error.
boolean isMarkedInvalid()
void addValidator(Validator validator)
Add extra validators to this component.
void removeValidator(Validator validator)
Remove an existing validator from this component.
java.util.List getValidators()
Retrieve the list of active validators on this component.
java.util.List getValidationErrors()
Retrieves a list of currently pending validation errors on this component.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |