Hi guys,
we had an RCP Product based on 4.1 using the compatibility layer. After switching the target platform to 4.2.2 the theming via css didn't work anymore on a deployed product, it only works in the IDE. Ater looking at the code in AbstractCSSEngine we found a change since 4.1
4.1:
URL url = FileLocator.resolve(new URL(trim.addTrailingSeparator().toString() + ((CSSImportRule) rule).getHref()));
InputStream stream = url.openStream();
4.2.2
URL url = FileLocator.resolve(new URL(trim.addTrailingSeparator().toString() + ((CSSImportRule) rule).getHref()));
File testFile = new File(url.getFile());
if (!testFile.exists()) {
//look in platform default
String path = getResourcesLocatorManager().resolve(((CSSImportRule) rule).getHref());
testFile = new File(new URL(path).getFile());
if (testFile.exists()) {
url = new URL(path);
}
}
InputStream stream = url.openStream();
This won't work if the file is in a deployed bundle.
We are using the "org.eclipse.e4.ui.css.swt.theme" extension point in our product
<extension
point="org.eclipse.e4.ui.css.swt.theme">
<theme
basestylesheeturi="css/e4_day.css"
id="default"
label="%Theme_Default">
</theme>
<theme
basestylesheeturi="css/e4_dark.css"
id="dark"
label="%Theme_dark">
</theme>
</extension>
Is this a known bug?
[Updated on: Tue, 05 March 2013 09:35]
Report message to a moderator