Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.view.util
Class ActiveBoundModel  view ActiveBoundModel download ActiveBoundModel.java

java.lang.Object
  extended byorg.scopemvc.view.util.BoundModel
      extended byorg.scopemvc.view.util.ActiveBoundModel
All Implemented Interfaces:
org.scopemvc.core.ModelChangeListener

public class ActiveBoundModel
extends BoundModel
implements org.scopemvc.core.ModelChangeListener

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.

Version:
$Revision: 1.7 $ $Date: 2002/01/26 09:46:20 $

Field Summary
private static org.apache.commons.logging.Log LOG
           
protected  org.scopemvc.core.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)
           
 
Method Summary
 java.lang.Class getPropertyClass()
           
 org.scopemvc.core.PropertyManager getPropertyManager()
           
 boolean getPropertyReadOnly()
           
 java.lang.Object getPropertyValue()
           
 void modelChanged(org.scopemvc.core.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)
           
 void setSelector(org.scopemvc.core.Selector inSelector)
           
 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

LOG

private static final org.apache.commons.logging.Log LOG

view

protected ModelBindable view
The ModelBindable View that delegates bound Model handling to this helper.


manager

protected org.scopemvc.core.PropertyManager manager
PropertyManager for the bound model.

Constructor Detail

ActiveBoundModel

public ActiveBoundModel(ModelBindable inView)
Method Detail

getPropertyManager

public org.scopemvc.core.PropertyManager getPropertyManager()

setBoundModel

public final void setBoundModel(java.lang.Object inModel)
Overrides:
setBoundModel in class BoundModel

setSelector

public final void setSelector(org.scopemvc.core.Selector inSelector)
Overrides:
setSelector in class BoundModel

modelChanged

public final void modelChanged(org.scopemvc.core.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.

Specified by:
modelChanged in interface org.scopemvc.core.ModelChangeListener

getPropertyReadOnly

public boolean getPropertyReadOnly()

getPropertyValue

public java.lang.Object getPropertyValue()

getPropertyClass

public java.lang.Class getPropertyClass()

updateFromModel

public void updateFromModel(int inEventType)
Calls parent View's {org.scopemvc.view.util.ModelBindable#validationSuccess} to clear any previous validation failure.


updateModel

public void updateModel()
Put the current View contents into the bound model property. Errors in getting the UI's new value into the model property are handled by calling back into the parent View's {org.scopemvc.view.util.ModelBindable#validationFailed} with the Exception. On no errors, call the parent's {org.scopemvc.view.util.ModelBindable#validationSuccess}