org.wamblee.wicket.page
Class CompositePageBehavior

java.lang.Object
  extended by org.wamblee.wicket.page.CompositePageBehavior
All Implemented Interfaces:
java.io.Serializable, PageBehavior

public class CompositePageBehavior
extends java.lang.Object
implements PageBehavior

Implements a composite page behavior which invokes all behaviors in the order they were added. To use this in an arbitrary page, override onBeforeRender(), setHeaders() and onAfterRender in the page and delegate to the corresponding methods in this class.

Author:
Erik Brakkee
See Also:
Serialized Form

Constructor Summary
CompositePageBehavior()
          Constructs the compositie.
 
Method Summary
 void add(PageBehavior aBehavior)
          Adds a behavior.
 void onAfterRender(org.apache.wicket.markup.html.WebPage aPage)
          To be called as part of the Page's onAfterRender
 void onBeforeRender(org.apache.wicket.markup.html.WebPage aPage)
          To be called as part of the Page's onBeforeRender
 void onDetach(org.apache.wicket.markup.html.WebPage aPage)
          To be called in the {@link Page#onDetach
 void setHeaders(org.apache.wicket.markup.html.WebPage aPage, org.apache.wicket.protocol.http.WebResponse aResponse)
          To be called as part of the Page's setHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositePageBehavior

public CompositePageBehavior()
Constructs the compositie.

Method Detail

add

public void add(PageBehavior aBehavior)
Adds a behavior.

Parameters:
aBehavior - Behavior

onBeforeRender

public void onBeforeRender(org.apache.wicket.markup.html.WebPage aPage)
Description copied from interface: PageBehavior
To be called as part of the Page's onBeforeRender

Specified by:
onBeforeRender in interface PageBehavior
Parameters:
aPage - Page this is called for.

setHeaders

public void setHeaders(org.apache.wicket.markup.html.WebPage aPage,
                       org.apache.wicket.protocol.http.WebResponse aResponse)
Description copied from interface: PageBehavior
To be called as part of the Page's setHeaders

Specified by:
setHeaders in interface PageBehavior
Parameters:
aPage - Page this is called for.
aResponse - Response to set headers for.

onAfterRender

public void onAfterRender(org.apache.wicket.markup.html.WebPage aPage)
Description copied from interface: PageBehavior
To be called as part of the Page's onAfterRender

Specified by:
onAfterRender in interface PageBehavior
Parameters:
aPage - Page this is called for.

onDetach

public void onDetach(org.apache.wicket.markup.html.WebPage aPage)
Description copied from interface: PageBehavior
To be called in the {@link Page#onDetach

Specified by:
onDetach in interface PageBehavior


Copyright © 2022. All Rights Reserved.