|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IRequestableComponent
Base interface for components. The purpose of this interface is to make certain parts of Wicket easier to mock and unit test.
| Method Summary | |
|---|---|
boolean |
canCallListenerInterface()
Returns true if the listener interface method can be called on this component. |
void |
detach()
Detaches the component. |
IRequestableComponent |
get(String path)
Gets the component at the given path. |
Behavior |
getBehaviorById(int id)
Gets the behavior for the specified id |
int |
getBehaviorId(Behavior behavior)
Gets a stable id for the specified behavior. |
String |
getId()
Gets the id of this component. |
IRequestablePage |
getPage()
Returns page this component belongs to. |
String |
getPageRelativePath()
Gets this component's path. |
| Method Detail |
|---|
String getPageRelativePath()
String getId()
IRequestablePage getPage()
nullIRequestableComponent get(String path)
path - Path to component
boolean canCallListenerInterface()
true if the listener can be called, false otherwise.int getBehaviorId(Behavior behavior)
behavior -
Behavior getBehaviorById(int id)
id -
null if none
InvalidBehaviorIdException - when behavior with this id cannot be foundvoid detach()
NOTE: this method is not inherited from IDetachable on purpose. in Wicket the
assumption for a long time has been that Components do not implement
IDetachable; doing so may lead to some very nasty side-effects. Consider
AbstractPropertyModel#detach() which looks like this:
public void detach()
{
// Detach nested object if it's a detachable
if (target instanceof IDetachable)
{
((IDetachable)target).detach();
}
}
If the model was constructed thusly, which is quite common: new PropertyModel(this,
"person") and Component implemented IDetachable then calling @{code
model.detach()} will cause an infinite loop with the model trying to detach the component and
the component trying to detach the model.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||