multiple custom themes extending from default theme [message #1822253] |
Mon, 02 March 2020 15:44  |
Karl Mehltretter Messages: 9 Registered: May 2016 |
Junior Member |
|
|
I want to create multiple custom themes, each extending the default css scheme for my application, so different entry points can use different themes.
The following works, but it is using internal details (DEFAULT_THEME_CSS, ThemeManager internal API class).
final String DEFAULT_THEME_CSS = "resource/theme/default.css";
// create theme1
application.addStyleSheet("theme1_id", DEFAULT_THEME_CSS, ThemeManager.STANDARD_RESOURCE_LOADER);
application.addStyleSheet("theme1_id", "mytheme1.css");
// create theme2
application.addStyleSheet("theme2_id", DEFAULT_THEME_CSS, ThemeManager.STANDARD_RESOURCE_LOADER);
application.addStyleSheet("theme2_id", "mytheme2.css");
Best Regards,
Karl
[Updated on: Mon, 02 March 2020 16:26] Report message to a moderator
|
|
|
Re: multiple custom themes extending from default theme [message #1822259 is a reply to message #1822253] |
Mon, 02 March 2020 16:21  |
Karl Mehltretter Messages: 9 Registered: May 2016 |
Junior Member |
|
|
I've now decided to use my "own" ResourceLoader, based on RWT class. This at least removes the warning about internal API access.
private static final String RWT_DEFAULT_THEME = "resource/theme/default.css";
public static final ResourceLoader RWT_RESOURCE_LOADER = new ResourceLoader() {
ClassLoader classLoader = RWT.class.getClassLoader();
@Override
public InputStream getResourceAsStream(String resourceName) throws IOException {
return classLoader.getResourceAsStream(resourceName);
}
};
[..]
// create theme1
application.addStyleSheet("theme1_id", RWT_DEFAULT_THEME, RWT_RESOURCE_LOADER);
application.addStyleSheet("theme1_id", "mytheme1.css");
// create theme2
application.addStyleSheet("theme2_id", RWT_DEFAULT_THEME, RWT_RESOURCE_LOADER);
application.addStyleSheet("theme2_id", "mytheme2.css");
}
]
[Updated on: Mon, 02 March 2020 16:26] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02076 seconds