|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.scopemvc.view.util.BoundModel | +--org.scopemvc.view.util.ActiveBoundModel
A BoundModel
that handles ModelChangeEvents and provides full two-way
data-binding between a View and its bound model property. The parent View
needs to implement the ModelBindable
interface to provide a generic
interface used by this delegate. An ActiveBoundModel registers itself as a
ModelChangeListener to the bound model object so that it can update its
parent View.
SwingBoundModel
Field Summary | |
protected PropertyManager |
manager
PropertyManager for the bound model. |
protected ModelBindable |
view
The ModelBindable View that delegates bound Model handling to this helper. |
Fields inherited from class org.scopemvc.view.util.BoundModel |
boundModel, selector |
Constructor Summary | |
ActiveBoundModel(ModelBindable inView)
Constructor for the ActiveBoundModel object |
Method Summary | |
java.lang.Class |
getPropertyClass()
Gets the class of the property in the bound model |
PropertyManager |
getPropertyManager()
Gets the property manager |
boolean |
getPropertyReadOnly()
Returns true if the property in the bound model is read only |
java.lang.Object |
getPropertyValue()
Gets the value of the property in the bound model |
void |
modelChanged(ModelChangeEvent inEvent)
Update the parent View in response to the passed ModelChangeEvent, if the event reports that the property we are bound to has changed. |
void |
setBoundModel(java.lang.Object inModel)
Sets the bound model |
void |
setSelector(Selector inSelector)
Sets the selector |
void |
updateFromModel(int inEventType)
Calls parent View's {org.scopemvc.view.util.ModelBindable#validationSuccess} to clear any previous validation failure. |
void |
updateModel()
Put the current View contents into the bound model property. |
Methods inherited from class org.scopemvc.view.util.BoundModel |
getBoundModel, getSelector, setSelectorString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ModelBindable view
protected PropertyManager manager
Constructor Detail |
public ActiveBoundModel(ModelBindable inView)
inView
- The view to bind to the modelMethod Detail |
public PropertyManager getPropertyManager()
public boolean getPropertyReadOnly()
public java.lang.Object getPropertyValue()
public java.lang.Class getPropertyClass()
public final void setBoundModel(java.lang.Object inModel)
setBoundModel
in class BoundModel
inModel
- The new boundModel valuepublic final void setSelector(Selector inSelector)
setSelector
in class BoundModel
inSelector
- The new selector valuepublic final void modelChanged(ModelChangeEvent inEvent)
modelChanged
in interface ModelChangeListener
inEvent
- The event describing the change in the modelpublic void updateModel()
public void updateFromModel(int inEventType)
inEventType
- The type of the change event, one of the ModelChangeTypes
values
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |