List of usage examples for org.apache.wicket.request.resource CssResourceReference CssResourceReference
public CssResourceReference(Key key)
From source file:org.apache.isis.viewer.wicket.ui.pages.PageAbstract.java
License:Apache License
/** * Contributes theme specific Bootstrap CSS overrides if there is such resource * * @param response The header response to contribute to *//*from w w w. j a v a 2 s. c om*/ private void contributeThemeSpecificOverrides(final IHeaderResponse response) { final IBootstrapSettings bootstrapSettings = Bootstrap.getSettings(getApplication()); final ITheme activeTheme = bootstrapSettings.getActiveThemeProvider().getActiveTheme(); final String name = activeTheme.name().toLowerCase(Locale.ENGLISH); final String themeSpecificOverride = "bootstrap-overrides-" + name + ".css"; final ResourceReference.Key themeSpecificOverrideKey = new ResourceReference.Key( PageAbstract.class.getName(), themeSpecificOverride, null, null, null); if (PackageResource.exists(themeSpecificOverrideKey)) { response.render(CssHeaderItem.forReference(new CssResourceReference(themeSpecificOverrideKey))); } }