In a RCP application development, I'm trying using a browser(org.eclipse.swt.browser.Browser) component to load local html file bundled in a plug-in. The plug-in project file structure is like below:
project-name
+-/src
+-/html
+/META-INF
...
In code, I use the below code to load html file:
String html = "/html/index.html";
URL url = FileLocator.find(Activator.getDefault().getBundle(), new Path(html), null);
url = FileLocator.toFileURL(url);
browser.setUrl(url.toString());
This html file (index.html) references some css file, javascript file and other html file. These resources resist in html folder. The above code works well in Eclipse development environment. But when I export to a RCP product, it loads this index.html, but the html file display layout is a chaos. I tried to find what happened, so I looked for the resource in my product workspace. I found a file named index.html in product workspace, but no other resources found. I think it's the cause. But how to solve this problem? Thanks!
Ju Xiaomi