Example usage for org.apache.wicket RuntimeConfigurationType DEVELOPMENT

List of usage examples for org.apache.wicket RuntimeConfigurationType DEVELOPMENT

Introduction

In this page you can find the example usage for org.apache.wicket RuntimeConfigurationType DEVELOPMENT.

Prototype

RuntimeConfigurationType DEVELOPMENT

To view the source code for org.apache.wicket RuntimeConfigurationType DEVELOPMENT.

Click Source Link

Usage

From source file:vlove.web.WicketApplication.java

License:Open Source License

/**
 * Do all our deploy-time magic.//from  www  .  ja v  a 2 s .c om
 * 
 * @See {@link WebApplication}
 */
@Override
protected void init() {
    log.info("vlove coming alive.");
    super.init();

    getComponentInstantiationListeners().add(new SpringComponentInjector(this));
    new AnnotatedMountScanner().scanPackage("vlove.web").mount(this);

    /*
     * getApplicationSettings().setAccessDeniedPage(AccessDeniedPage.class); getApplicationSettings().setInternalErrorPage(ErrorPage.class); getApplicationSettings().setPageExpiredErrorPage(PageExpiredPage.class);
     */

    getMarkupSettings().setStripComments(true);
    getMarkupSettings().setStripWicketTags(true);

    final RuntimeConfigurationType devType = getConfigurationType();
    if (devType != null && devType.equals(RuntimeConfigurationType.DEVELOPMENT)) {
        getResourceSettings().setResourceWatcher(new ModificationWatcher());
        getResourceSettings().setResourcePollFrequency(Duration.seconds(1));
    }

    // getSecuritySettings().setAuthorizationStrategy(new
    // AcsAnnotationAuthorizationStrategy(getLoginPage()));
    getSecuritySettings().setEnforceMounts(true);

    log.info("It's alive, aliiiiiive!");
}

From source file:wicket.contrib.gmap3.GMap.java

License:Apache License

/**
 * On render.//  w ww  .  ja  v a 2  s .co m
 *
 * @see org.apache.wicket.MarkupContainer#onRender(org.apache.wicket.markup.MarkupStream)
 */
@Override
protected void onRender() {
    super.onRender();
    if (RuntimeConfigurationType.DEVELOPMENT.equals(Application.get().getConfigurationType())
            && !Application.get().getMarkupSettings().getStripWicketTags()) {
        log.warn("Application is in DEVELOPMENT mode && Wicket tags are not stripped,"
                + "Some Chrome Versions will not render the GMap."
                + " Change to DEPLOYMENT mode  || turn on Wicket tags stripping." + " See:"
                + " http://www.nabble.com/Gmap2-problem-with-Firefox-3.0-to18137475.html.");
    }
}

From source file:wicket.contrib.tinymce.TinyMceBehavior.java

License:Open Source License

/**
 * <p>//from  w  ww  .  jav a 2 s. c  o  m
 * TinyMCE javascript resource.
 * </p>
 * <p>
 * <strong>Note</strong>: The TinyMCE source cannot be lazily loaded via ajax. Therefore, adding
 * this in a {@link IHeaderContributor#renderHead(IHeaderResponse)} must be done in a component
 * that is not rendered via Ajax. If you wish to load this via Ajax, you can use the very hacky
 * workaround {@link TinyMceBehavior#lazyLoadTinyMCEResource(IHeaderResponse)}.
 * </p>
 * 
 * @return
 */
protected ResourceReference getTinyMCEReference() {
    Application app = Application.get();
    if (RuntimeConfigurationType.DEVELOPMENT.equals(app.getConfigurationType()))
        return TinyMCESettings.REFERENCE;
    else
        return TinyMCESettings.REFERENCE_MIN;
}

From source file:wicket.contrib.tinymce4.TinyMceBehavior.java

License:Open Source License

/**
 * <p>/*from ww w  .j  a v a  2 s.c om*/
 * TinyMCE javascript resource.
 * </p>
 * <p>
 * <strong>Note</strong>: The TinyMCE source cannot be lazily loaded via ajax. Therefore, adding
 * this in a {@link IHeaderContributor#renderHead(IHeaderResponse)} must be done in a component
 * that is not rendered via Ajax. If you wish to load this via Ajax, you can use the very hacky
 * workaround {@link #lazyLoadTinyMCEResource(IHeaderResponse)}.
 * </p>
 * 
 * @return
 */
protected ResourceReference getTinyMCEReference() {
    Application app = Application.get();
    if (RuntimeConfigurationType.DEVELOPMENT.equals(app.getConfigurationType()))
        return TinyMCESettings.TINYMCE_JS_REF;
    else
        return TinyMCESettings.TINYMCE_JS_REF_MIN;
}