net.sf.jzeno.echo.databinding
Class RebindablePropertyComponentSupport2

java.lang.Object
  extended by net.sf.jzeno.echo.databinding.RebindablePropertyComponentSupport2
All Implemented Interfaces:
java.io.Serializable, PropertyComponent, RebindableComponent

public class RebindablePropertyComponentSupport2
extends java.lang.Object
implements RebindableComponent, java.io.Serializable

Support class implementing most behaviour in the Editor interface. Add one of these to your editor and implement the interface with delegating methods.

See Also:
Serialized Form

Nested Class Summary
static class RebindablePropertyComponentSupport2.ExtraState
           
static class RebindablePropertyComponentSupport2.State
           
 
Field Summary
 java.lang.Object bean
           
static long serialVersionUID
           
 
Constructor Summary
RebindablePropertyComponentSupport2()
           
RebindablePropertyComponentSupport2(java.lang.Class beanClass, java.lang.String property, PropertyComponent owner)
           
 
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.Object getNullObject()
           
 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 isBound()
           
 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 rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void removeValidator(Validator validator)
           Remove an existing validator from this component.
 void setBean(java.lang.Object newBean)
          Set bean allows you to override the bean used for databinding.
 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 setNullObject(java.lang.Object nullObject)
           This object should be returned by the implementor in getValue, when the property path ends in a null value.
 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.
 java.util.List traceValue()
           Reads the properties in this components property path, and traces all read properties, returning the actual property values in a List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

bean

public java.lang.Object bean
Constructor Detail

RebindablePropertyComponentSupport2

public RebindablePropertyComponentSupport2()

RebindablePropertyComponentSupport2

public RebindablePropertyComponentSupport2(java.lang.Class beanClass,
                                           java.lang.String property,
                                           PropertyComponent owner)
Method Detail

getBean

public java.lang.Object getBean()
Description copied from interface: PropertyComponent

Retrieve the root bean this editor is bound to.

Specified by:
getBean in interface PropertyComponent

setBean

public void setBean(java.lang.Object newBean)
Set bean allows you to override the bean used for databinding. You should NOT normally do this, stick with the default behaviour of selecting the closest BindingTarget

Specified by:
setBean in interface PropertyComponent

getProperty

public java.lang.String getProperty()
Description copied from interface: PropertyComponent

Retrieve the property path to bind to on the domain model cluster.

Specified by:
getProperty in interface PropertyComponent

setProperty

public void setProperty(java.lang.String propertyPath)
Description copied from interface: PropertyComponent

Set the property(path) to bind to on the domain model cluster.

Specified by:
setProperty in interface PropertyComponent

getValue

public java.lang.Object getValue()
Description copied from interface: PropertyComponent

Retrieve the property value from the domain model cluster.

Specified by:
getValue in interface PropertyComponent

setValue

public void setValue(java.lang.Object value)
Description copied from interface: PropertyComponent

Writes the supplied data into the property we are bound to.

Specified by:
setValue in interface PropertyComponent

isValid

public boolean isValid()
Description copied from interface: PropertyComponent

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).

Specified by:
isValid in interface PropertyComponent

isRequired

public boolean isRequired()
Description copied from interface: PropertyComponent

Query if the editor is required to be filled in.

Specified by:
isRequired in interface PropertyComponent

setRequired

public void setRequired(boolean required)
Description copied from interface: PropertyComponent

Determine if the editor is required to be filled in.

Specified by:
setRequired in interface PropertyComponent

rebind

public void rebind()
Description copied from interface: RebindableComponent

This operation causes the component to reset it's content to that of the domain model.

Specified by:
rebind in interface RebindableComponent

getDecorator

public Decorator getDecorator()
Description copied from interface: PropertyComponent

Gets the decorator, if any is configured.

Specified by:
getDecorator in interface PropertyComponent

setDecorator

public void setDecorator(Decorator decorator)
Description copied from interface: PropertyComponent

Sets the decorator.

Specified by:
setDecorator in interface PropertyComponent

isBound

public boolean isBound()

getBeanClass

public java.lang.Class getBeanClass()
Description copied from interface: PropertyComponent

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.)

Specified by:
getBeanClass in interface PropertyComponent

setBeanClass

public void setBeanClass(java.lang.Class beanClass)
Description copied from interface: PropertyComponent

Change the type of model bean this property component will be bound to.

Specified by:
setBeanClass in interface PropertyComponent

getNullObject

public java.lang.Object getNullObject()
Specified by:
getNullObject in interface RebindableComponent

setNullObject

public void setNullObject(java.lang.Object nullObject)
Description copied from interface: RebindableComponent

This object should be returned by the implementor in getValue, when the property path ends in a null value.

Specified by:
setNullObject in interface RebindableComponent

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface PropertyComponent

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: PropertyComponent

Mark this component as read-only.

Specified by:
setReadOnly in interface PropertyComponent

preRender

public void preRender()
Description copied from interface: PropertyComponent

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.

Specified by:
preRender in interface PropertyComponent

markInvalid

public void markInvalid()
Description copied from interface: PropertyComponent

Marks the component as invalid. Typically puts a colored border around it to indicate the error.

Specified by:
markInvalid in interface PropertyComponent

markValid

public void markValid()
Description copied from interface: PropertyComponent

Marks the component as valid (remove error marking)

Specified by:
markValid in interface PropertyComponent

isMarkedInvalid

public boolean isMarkedInvalid()
Specified by:
isMarkedInvalid in interface PropertyComponent

traceValue

public java.util.List traceValue()
Description copied from interface: RebindableComponent

Reads the properties in this components property path, and traces all read properties, returning the actual property values in a List.

Specified by:
traceValue in interface RebindableComponent

getValidationErrors

public java.util.List getValidationErrors()
Description copied from interface: PropertyComponent

Retrieves a list of currently pending validation errors on this component.

Specified by:
getValidationErrors in interface PropertyComponent

addValidator

public void addValidator(Validator validator)
Description copied from interface: PropertyComponent

Add extra validators to this component.

Specified by:
addValidator in interface PropertyComponent

removeValidator

public void removeValidator(Validator validator)
Description copied from interface: PropertyComponent

Remove an existing validator from this component.

Specified by:
removeValidator in interface PropertyComponent

getValidators

public java.util.List getValidators()
Description copied from interface: PropertyComponent

Retrieve the list of active validators on this component.

Specified by:
getValidators in interface PropertyComponent