|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.joseluismartin.gui.bind.AbstractBinder
public abstract class AbstractBinder
Base class for Binders. Implement doBind() to do the binding. Dereference ModelHolders when setting its as binded model.
Field Summary | |
---|---|
protected Object |
component
component object |
protected Object |
oldValue
last value, used to revert o detect cicles |
protected String |
propertyName
binded property name |
protected boolean |
readOnly
if true, binding is readOnly, ie from model to control |
Constructor Summary | |
---|---|
AbstractBinder()
|
Method Summary | |
---|---|
void |
bind(Object component,
String propertyName,
Object model)
Bind changes on component to a model property |
void |
bind(Object component,
String propertyName,
Object model,
boolean readOnly)
Bind changes on component to a model property |
protected org.springframework.validation.BindingResult |
createBindingResult()
Create a new Binding result, override to set nested paths on complex binders |
protected void |
doBind()
Hook method to do bind via Component Listeners By default, do nothing |
protected abstract void |
doRefresh()
|
protected abstract void |
doUpdate()
|
org.springframework.validation.BindingResult |
getBindingResult()
Get binding result |
Object |
getComponent()
|
Object |
getModel()
Gets model |
protected Object |
getOldValue()
|
String |
getPropertyName()
return property name |
protected Object |
getValue()
Get value from model |
void |
refresh()
Update Component from model |
void |
setComponent(Object component)
|
void |
setModel(Object model)
Sets model |
protected void |
setOldValue(Object oldValue)
|
void |
setPropertyName(String propertyName)
|
protected void |
setValue(Object value)
Set value on binded object using the property name. |
void |
update()
Update Model from Component |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String propertyName
protected Object oldValue
protected Object component
protected boolean readOnly
Constructor Detail |
---|
public AbstractBinder()
Method Detail |
---|
public final void bind(Object component, String propertyName, Object model)
bind
in interface PropertyBinder
component
- component to bindpropertyName
- the property name to bindmodel
- model to bind.public final void bind(Object component, String propertyName, Object model, boolean readOnly)
bind
in interface PropertyBinder
component
- component to bindpropertyName
- the property name to bindmodel
- model to bind.readOnly
- if true, the binding is readOnly, ie from model to control.protected void doBind()
component
- Component to bindpublic final void refresh()
Binder
refresh
in interface Binder<Object>
public final void update()
Binder
update
in interface Binder<Object>
protected org.springframework.validation.BindingResult createBindingResult()
protected abstract void doRefresh()
protected abstract void doUpdate()
protected void setValue(Object value)
value
- the value to setprotected Object getValue()
public String getPropertyName()
PropertyBinder
getPropertyName
in interface PropertyBinder
public void setPropertyName(String propertyName)
protected Object getOldValue()
protected void setOldValue(Object oldValue)
public Object getModel()
ModelHolder
getModel
in interface ModelHolder<Object>
public void setModel(Object model)
ModelHolder
setModel
in interface ModelHolder<Object>
public Object getComponent()
getComponent
in interface PropertyBinder
public void setComponent(Object component)
component
- the component to setpublic org.springframework.validation.BindingResult getBindingResult()
Binder
getBindingResult
in interface Binder<Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |