Example usage for org.apache.wicket.protocol.http WebApplication getComponentPreOnBeforeRenderListeners

List of usage examples for org.apache.wicket.protocol.http WebApplication getComponentPreOnBeforeRenderListeners

Introduction

In this page you can find the example usage for org.apache.wicket.protocol.http WebApplication getComponentPreOnBeforeRenderListeners.

Prototype

public final ComponentOnBeforeRenderListenerCollection getComponentPreOnBeforeRenderListeners() 

Source Link

Usage

From source file:org.brixcms.Brix.java

License:Apache License

/**
 * Performs any {@link WebApplication} specific initialization
 *
 * @param application//www .  j  a  va  2 s .com
 */
public void attachTo(WebApplication application) {
    if (application == null) {
        throw new IllegalArgumentException("Application cannot be null");
    }

    // store brix instance in applicaton's metadata so it can be retrieved
    // easily later
    application.setMetaData(APP_KEY, this);

    /*
       * XXX we are coupling to nodepage plugin here instead of using the
       * usual register mechanism - we either need to make plugins application
       * aware so they can install their own listeners or have some brix-level
       * registery
       */
    application.getComponentPreOnBeforeRenderListeners().add(new PageParametersAwareEnabler());

    // allow brix to handle any url that wicket cant
    application.getRootRequestMapperAsCompound().add(new BrixRequestMapper(this));
    // application.mount(new BrixNodePageUrlMapper());

    // register a string resource loader that allows any object that acts as
    // an extension supply its own resource bundle for the UI
    BrixExtensionStringResourceLoader loader = new BrixExtensionStringResourceLoader();
    application.getResourceSettings().getStringResourceLoaders().add(loader);
    config.getRegistry().register(loader, true);
}