/** * renders a given header item with filter if present. * * @param response The current header response * @param headerItem The header item to render */ public static void renderWithFilter(final IHeaderResponse response, final JavaScriptReferenceHeaderItem headerItem) { renderWithFilter(Bootstrap.getSettings(), response, headerItem); }
/** * Construct. Uses {@link de.agilecoders.wicket.settings.IBootstrapSettings#getJsResourceFilterName()} * as filter name. */ public RenderJavaScriptToFooterHeaderResponseDecorator() { this(Bootstrap.getSettings().getJsResourceFilterName()); }
/** * use fixed variation value to trigger {@link LessResourceStreamLocator} * * @return static string {@link LessResourceReference#VARIATION} if less is active */ @Override public final String getVariation() { return Bootstrap.getSettings().getBootstrapLessCompilerSettings().useLessCompiler() ? VARIATION : null; } }
/** * renders all core bootstrap resource references * * @param component current component * @param response The current {@link IHeaderResponse} */ public static void renderHead(final Component component, final IHeaderResponse response) { BootstrapResourcesBehavior.instance().renderHead(getSettings(component.getApplication()), response); }
/** * @return charset setting */ protected final Charset getCharset() { if (Application.exists()) { return Bootstrap.getSettings().getBootstrapLessCompilerSettings().getCharset(); } else { LOG.warn("no application assigned to current thread, return default charset: {}", Charsets.UTF_8); return Charsets.UTF_8; } } }
protected final IBootstrapSettings getBootstrapSettings() { return Bootstrap.getSettings(application); }
@Override protected IBootstrapSettings createBootstrapSettings() { IBootstrapSettings settings = super.createBootstrapSettings(); settings.getBootstrapLessCompilerSettings() .setUseLessCompiler(true) .setCacheStrategy(IBootstrapLessCompilerSettings.CacheStrategy.Never); return settings; }
/** * @return the {@link ThemeProvider} implementation */ private ThemeProvider themeProvider() { if (Application.exists()) { return Bootstrap.getSettings().getThemeProvider(); } else { throw new WicketRuntimeException("no application assigned to current thread"); } }
@Override protected void init() { super.init(); Bootstrap.install(this, WicketApplicationTest.this.createBootstrapSettings()); }
@Override protected void init() { super.init(); Bootstrap.install(this, WicketApplicationTest.this.createBootstrapSettings()); }
@Override protected void onBefore() { super.onBefore(); component = new WebMarkupContainer("id"); component.setOutputMarkupId(true); }
@Override public Class<? extends Page> getHomePage() { return WicketApplicationTest.this.getHomePage(); }
/** * @return true if less compiler should be used. */ private static boolean useLessCompiler() { return Bootstrap.getSettings().getBootstrapLessCompilerSettings().useLessCompiler(); }
/** * renders all core bootstrap resource references * * @param response The current {@link IHeaderResponse} */ public static void renderHead(final IHeaderResponse response) { BootstrapResourcesBehavior.instance().renderHead(getSettings(Application.get()), response); } }
protected final IBootstrapSettings getBootstrapSettings() { return Bootstrap.getSettings(application); }
@Override protected void onBefore() { super.onBefore(); component = new WebMarkupContainer("id"); component.setOutputMarkupId(true); }
/** * returns the {@link IBootstrapSettings} which are assigned to current application * * @return assigned {@link IBootstrapSettings} */ public static IBootstrapSettings getSettings() { if (Application.exists()) { return getSettings(Application.get()); } throw new IllegalStateException("there is no active application assigned to this thread."); }
@Override protected void onBefore() { super.onBefore(); component = new WebMarkupContainer("id"); component.setOutputMarkupId(true); }
/** * returns the {@link IBootstrapSettings} implementation like {@link de.agilecoders.wicket.settings.BootstrapSettings} * which was bound to the current application. * * @param component the bound component * @return the bound {@link IBootstrapSettings} */ protected final IBootstrapSettings getBootstrapSettings(Component component) { IBootstrapSettings settings = Bootstrap.getSettings(component.getApplication()); if (settings == null) { throw new WicketRuntimeException("No BootstrapSettings associated with this Application. Did you call Bootstrap.install()?"); } return settings; }
@Before public final void before() { application = new WebApplication() { @Override protected void init() { super.init(); Bootstrap.install(this, WicketApplicationTest.this.createBootstrapSettings()); } @Override public Class<? extends Page> getHomePage() { return WicketApplicationTest.this.getHomePage(); } }; tester = new WicketTester(application); onBefore(); }