|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectwicket.model.AbstractDetachableModel
This provide a base class to work with detachable IModels.
It encapsulates the logic for attaching and detaching models. The
onAttach() abstract method will be called at the first access to the model
within a request and - if the model was attached earlier, onDetach() will be
called at the end of the request. In effect, attachment and detachment is
only done when it is actually needed.
| Constructor Summary | |
AbstractDetachableModel()
|
|
| Method Summary | |
void |
attach()
Attaches the model. |
void |
detach()
Detaches model after use. |
abstract IModel |
getNestedModel()
Gets the nested model. |
java.lang.Object |
getObject(Component component)
Gets the model object. |
boolean |
isAttached()
Gets whether this model has been attached to the current session. |
protected abstract void |
onAttach()
Attaches to the current request. |
protected abstract void |
onDetach()
Detaches from the current request. |
protected abstract java.lang.Object |
onGetObject(Component component)
Called when getObject is called in order to retrieve the detachable object. |
protected abstract void |
onSetObject(Component component,
java.lang.Object object)
Called when setObject is called in order to change the detachable object. |
void |
setObject(Component component,
java.lang.Object object)
Sets the model object. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AbstractDetachableModel()
| Method Detail |
public final void attach()
public final void detach()
IDetachable
detach in interface IDetachableIDetachable.detach()public abstract IModel getNestedModel()
IModel
getNestedModel in interface IModelIModel.getNestedModel()public final java.lang.Object getObject(Component component)
IModel
getObject in interface IModelcomponent - The component which wants to get a model Object
IModel.getObject(Component)public boolean isAttached()
public final void setObject(Component component,
java.lang.Object object)
IModel
setObject in interface IModelcomponent - The component which wants to set a new model Objectobject - The model objectIModel.setObject(Component, Object)public java.lang.String toString()
Object.toString()protected abstract void onAttach()
protected abstract void onDetach()
protected abstract java.lang.Object onGetObject(Component component)
component - The component asking for the object
protected abstract void onSetObject(Component component,
java.lang.Object object)
component - The component asking for replacement of the model objectobject - The new model object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||