[ https://issues.apache.org/jira/browse/WICKET-5635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-5635. ------------------------------------- Resolution: Fixed Fix Version/s: 6.17.0 7.0.0-M3 With 6.17 it will be possible to set custom IResourceReferenceFactory to ResourceReferenceRegistry. BootstrapLess#install(Application) setups LessResourceReferenceFactory automatically. See https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/420 > 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 > Fix For: 7.0.0-M3, 6.17.0 > > > 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)