Open l0rdn1kk0n opened 10 years ago
de.agilecoders.wicket.core.settings.DefaultThemeProvider#defaultTheme(de.agilecoders.wicket.core.settings.ITheme)
is a bit strange - it converts an ITheme
to a String
(its name) and passes it to de.agilecoders.wicket.core.settings.DefaultThemeProvider#defaultTheme(java.lang.String)
where this String is converted back to ITheme
Update: improved with https://github.com/l0rdn1kk0n/wicket-bootstrap/commit/58a8e2280371a388b303a1517d03e1bca32df045
de.agilecoders.wicket.themes.markup.html.bootstrap.Bootstrap3Theme issues:
Bootstrap3ThemeCssReference.instance()
twice to super
Update: fixed with https://github.com/l0rdn1kk0n/wicket-bootstrap/commit/e67a05bff7335b15c316dcfd718d78c976a1ddc5
It would be nice to get advantage of the new functionality provided by https://issues.apache.org/jira/browse/WICKET-5617
At the moment I have this local patch in wicket-7.0.0-M1 branch:
--- i/bootstrap-themes/src/main/java/de/agilecoders/wicket/themes/markup/html/bootswatch/BootswatchTheme.java
+++ w/bootstrap-themes/src/main/java/de/agilecoders/wicket/themes/markup/html/bootswatch/BootswatchTheme.java
@@ -51,10 +51,12 @@ public enum BootswatchTheme implements ITheme {
if (cdnUrl == null) {
cdnUrl = String.format(CDN_PATTERN, getVersion(), name().toLowerCase());
}
- response.render(CssHeaderItem.forReference(new UrlResourceReference(Url.parse(cdnUrl))));
+ CssHeaderItem item = CssHeaderItem.forReference(new UrlResourceReference(Url.parse(cdnUrl)),
+ null, null, null).setId("wb-theme");
+ response.render(item);
}
else {
- response.render(CssHeaderItem.forReference(reference));
+ response.render(CssHeaderItem.forReference(reference).setId("wb-theme"));
}
But I face the following problems:
enum
and it is not possible to override its #renderHead()
method locallyUpdate: Improved with 76c8d36 in wicket-7.0.0-M1 branch (the living branch against Wicket 7.0.0-SNAPSHOT).
we've to improve the theme and resource handling because it leads to some strange behavior.
see also: #347, #345, #344