|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IBehavior
Behaviors are kind of plug-ins for Components. They allow to be added to a component and get essential events forwarded by the component. they can be bound to a concrete component (using the bind method is called when the behavior is attached), but they don't need to. They can modify the components markup by changing the rendered ComponentTag. Behaviors can have their own models as well, and they are notified when these are to be detached by the component.
It is recommended that you extend from AbstractBehavior
instead of directly implementing this interface.
IBehaviorListener
,
IHeaderContributor
,
AbstractAjaxBehavior
,
AttributeModifier
Method Summary | |
---|---|
void |
afterRender(Component component)
Called when a component that has this behavior coupled was rendered. |
void |
beforeRender(Component component)
Called when a component is about to render. |
void |
bind(Component component)
Bind this handler to the given component. |
void |
detach(Component component)
Allows the behavior to detach any state it has attached during request processing. |
void |
exception(Component component,
java.lang.RuntimeException exception)
In case an unexpected exception happened anywhere between onComponentTag() and rendered(), onException() will be called for any behavior. |
boolean |
getStatelessHint(Component component)
This method returns false if the behavior generates a callback url (for example ajax behaviors) |
boolean |
isEnabled(Component component)
Called when a components is rendering and wants to render this behavior. |
boolean |
isTemporary()
Specifies whether or not this behavior is temporary. |
void |
onComponentTag(Component component,
ComponentTag tag)
Called any time a component that has this behavior registered is rendering the component tag. |
Method Detail |
---|
void beforeRender(Component component)
component
- the component that has this behavior coupledvoid afterRender(Component component)
component
- the component that has this behavior coupledvoid bind(Component component)
component
- the component to bind tovoid detach(Component component)
component
- the component that initiates the detachment of this behaviorvoid exception(Component component, java.lang.RuntimeException exception)
afterRender(Component)
, you should do the same in the implementation of this
method.
component
- the component that has a reference to this behavior and during which processing
the exception occurredexception
- the unexpected exceptionboolean getStatelessHint(Component component)
component
- the component that has this behavior coupled.
boolean isEnabled(Component component)
component
- the component that has this behavior coupled
void onComponentTag(Component component, ComponentTag tag)
component
- the component that renders this tag currentlytag
- the tag that is renderedboolean isTemporary()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |