use of org.apache.wicket.request.resource.ResourceReference in project wicket by apache.
the class ModalWindow method renderHead.
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
CoreLibrariesContributor.contributeAjax(getApplication(), response);
response.render(JavaScriptHeaderItem.forReference(JAVASCRIPT));
ResourceReference cssResource = newCssResource();
if (cssResource != null) {
response.render(CssHeaderItem.forReference(cssResource));
}
}
use of org.apache.wicket.request.resource.ResourceReference in project wicket by apache.
the class WicketAjaxDebugJQueryResourceReference method getDependencies.
@Override
public List<HeaderItem> getDependencies() {
final ResourceReference wicketAjaxReference;
if (Application.exists()) {
wicketAjaxReference = Application.get().getJavaScriptLibrarySettings().getWicketAjaxReference();
} else {
wicketAjaxReference = WicketAjaxJQueryResourceReference.get();
}
List<HeaderItem> dependencies = super.getDependencies();
dependencies.add(JavaScriptHeaderItem.forReference(wicketAjaxReference));
return dependencies;
}
use of org.apache.wicket.request.resource.ResourceReference in project wicket by apache.
the class WicketAjaxJQueryResourceReference method getDependencies.
@Override
public List<HeaderItem> getDependencies() {
final ResourceReference jqueryReference;
if (Application.exists()) {
jqueryReference = Application.get().getJavaScriptLibrarySettings().getJQueryReference();
} else {
jqueryReference = JQueryResourceReference.getV2();
}
List<HeaderItem> dependencies = super.getDependencies();
dependencies.add(JavaScriptHeaderItem.forReference(jqueryReference));
return dependencies;
}
use of org.apache.wicket.request.resource.ResourceReference in project wicket by apache.
the class ResourceMapperTest method before.
/**
* @throws Exception
*/
@Before
public void before() throws Exception {
resource = new TestResource();
tester.getApplication().getSharedResources().add(SHARED_NAME, resource);
ResourceReference resourceReference = new SharedResourceReference(SHARED_NAME);
mapper = new ResourceMapper("/test/resource", resourceReference);
mapperWithPlaceholder = new ResourceMapper("/test2/${name}/resource", resourceReference);
tester.getApplication().getRootRequestMapperAsCompound().add(mapper);
}
use of org.apache.wicket.request.resource.ResourceReference in project wicket by apache.
the class SharedResources method add.
/**
* Adds a resource.
*
* @param scope
* Scope of resource
* @param name
* Logical name of resource
* @param locale
* The locale of the resource
* @param style
* The resource style (see {@link org.apache.wicket.Session})
* @param variation
* The component specific variation of the style
* @param resource
* Resource to store
*/
public final void add(final Class<?> scope, final String name, final Locale locale, final String style, final String variation, final IResource resource) {
ResourceReference ref = new AutoResourceReference(scope, name, locale, style, variation, resource);
registry.registerResourceReference(ref);
}
Aggregations