Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » AbstractCSSEngine MalFormedURLException in a deployed RCP product
AbstractCSSEngine MalFormedURLException in a deployed RCP product [message #1016153] Tue, 05 March 2013 09:33
Quang Tran is currently offline Quang Tran
Messages: 11
Registered: June 2012
Junior Member
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

Previous Topic:Switching Themes in E3 mode
Next Topic:Running Juno to generate RCP e3
Goto Forum:
  


Current Time: Tue Sep 30 20:13:12 GMT 2014

Powered by FUDForum. Page generated in 0.01701 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software