public abstract class Behavior extends Object implements IClusterable, IComponentAwareEventSink, IComponentAwareHeaderContributor
You also cannot modify a components model with a behavior.
IBehaviorListener
,
IHeaderContributor
,
AbstractAjaxBehavior
,
AttributeModifier
,
Serialized FormConstructor and Description |
---|
Behavior()
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
canCallListenerInterface(Component component,
Method method)
Checks whether or not a listener interface can be invoked on this behavior.
|
void |
detach(Component component)
Allows the behavior to detach any state it has attached during request processing.
|
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(Component component)
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.
|
void |
onConfigure(Component component)
Called immediately after the onConfigure method in a component.
|
void |
onEvent(Component component,
IEvent<?> event)
Called to notify the behavior about any events sent to the component
|
void |
onException(Component component,
RuntimeException exception)
In case an unexpected exception happened anywhere between
onComponentTag(org.apache.wicket.Component, org.apache.wicket.markup.ComponentTag) and
afterRender(org.apache.wicket.Component),
onException() will be called for any behavior.
|
void |
onRemove(Component component)
Called to notify that the component is being removed from its parent
|
void |
renderHead(Component component,
IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section.
|
void |
unbind(Component component)
Notifies the behavior it is removed from the specified component
|
public void beforeRender(Component component)
component
- the component that has this behavior coupledpublic void afterRender(Component component)
component
- the component that has this behavior coupledpublic void bind(Component component)
component
- the component to bind topublic void unbind(Component component)
component
- the component this behavior is unbound frompublic void detach(Component component)
component
- the component that initiates the detachment of this behaviorpublic void onException(Component component, 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 exceptionpublic boolean getStatelessHint(Component component)
component
- the component that has this behavior coupled.public boolean isEnabled(Component component)
component
- the component that has this behavior coupledpublic void onComponentTag(Component component, ComponentTag tag)
component
- the component that renders this tag currentlytag
- the tag that is renderedpublic boolean isTemporary(Component component)
component
- public boolean canCallListenerInterface(Component component, Method method)
Component.canCallListenerInterface(Method)
,
this method has the same semantics.
WARNING: Read the javadoc of Component.canCallListenerInterface(Method)
for important
security-related information.component
- component this behavior is attached tomethod
- listener method being invokedpublic void renderHead(Component component, IHeaderResponse response)
renderHead
in interface IComponentAwareHeaderContributor
component
- response
- Response objectpublic void onConfigure(Component component)
component
- the component being configuredpublic void onEvent(Component component, IEvent<?> event)
onEvent
in interface IComponentAwareEventSink
component
- component that owns this sink. For example, if the implementation of this
interface is a Behavior
then component parameter will contain the
component to which the behavior is attached.IComponentAwareEventSink.onEvent(org.apache.wicket.Component,
org.apache.wicket.event.IEvent)
public void onRemove(Component component)
component
- the removed componentCopyright © 2006–2016 Apache Software Foundation. All rights reserved.