You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/07/21 11:21:38 UTC
[jira] [Assigned] (WICKET-5635) Provide a way to modify
ResourceReferenceRegistry.DefaultResourceReferenceFactory externally to be
used by wicket-bootstrap-less
[ https://issues.apache.org/jira/browse/WICKET-5635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov reassigned WICKET-5635:
---------------------------------------
Assignee: Martin Grigorov
> Provide a way to modify ResourceReferenceRegistry.DefaultResourceReferenceFactory externally to be used by wicket-bootstrap-less
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: WICKET-5635
> URL: https://issues.apache.org/jira/browse/WICKET-5635
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 6.16.0
> Reporter: Hendy Irawan
> Assignee: Martin Grigorov
>
> As described in https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/409#issuecomment-48505042 :
> Add
> {code}
> @Override
> protected ResourceReferenceRegistry newResourceReferenceRegistry() {
> return new LessAwareRR(super.newResourceReferenceRegistry());
> }
> private static class LessAwareRR extends ResourceReferenceRegistry {
> private final ResourceReferenceRegistry delegate;
> private LessAwareRR(ResourceReferenceRegistry delegate) {
> this.delegate = delegate;
> }
> @Override
> protected ResourceReference createDefaultResourceReference(ResourceReference.Key key) {
> if (key.getName().endsWith(".less")) {
> return new LessResourceReference(key);
> }
> return super.createDefaultResourceReference(key);
> }
> }
> {code}
> to WicketApplication.java and it starts to work as desired.
> Another way to do the same is:
> {code}
> @Override
> protected ResourceReferenceRegistry newResourceReferenceRegistry() {
> return new ResourceReferenceRegistry(new LessRRFactory());
> }
> private static class LessRRFactory extends ResourceReferenceRegistry.DefaultResourceReferenceFactory {
> @Override
> public ResourceReference create(ResourceReference.Key key) {
> if (key.getName().endsWith(".less")) {
> return new LessResourceReference(key);
> } else {
> return super.create(key);
> }
> }
> }
> {code}
> Unfortunately at the moment there is no way to do this automatically with {{de.agilecoders.wicket.less.BootstrapLess#install(Appllication)}}.
--
This message was sent by Atlassian JIRA
(v6.2#6252)