DISQUS

Gareth Jones: SWT browser widgets and local plugin files

  • Chris · 1 year ago
    Hi Gareth, Thanks for this, it's just helped me to do exactly what I wanted to do in an RCP application - have it open with a welcome page with some static content and an iframe for the latest news etc.. However, when I export the application to create a download, the welcome page comes up but with all the images missing. Obviously they aren't part of index.html. Have you come across this? And, if so, do you know how to solve it? Any pointers you can offer me would be gratefully received as I don't have much time to get this done!
  • Chris · 1 year ago
    No need to reply as I seem to have found it. Thought I'd post it here in case anybody else is wondering the same thing.

    The key was in the following post:
    http://dev.eclipse.org/newslists/news.eclipse.p...

    This meant I had to read in the initial HTML file and replace a marker with the actual base url within the plugin (which I had retrieved using the method above) and all went swimmingly! Thanks for posting this and giving me a clue in the first place!
  • Chris · 1 year ago
    Oops. Spoke too soon. Worked when run inside Eclipse. Didn't once exported (even though the base URL looks right). Still looking for clues. Anybody?
  • Chris · 1 year ago
    Hopefully my last comment on the matter.

    I was close but one extra step was needed. The feature that held my HTML needed to be unpacked (tick the box in feature.xml to say it should be unpacked when installed) - then the base tag worked.
  • garethj · 1 year ago
    Hi Chris, looks like you answered yourself several times before I got the chance :)

    Will be useful info for anyone else that has the same issue (and me if I need to do it) so thanks for posting up the answer.
  • rupa · 3 months ago
    Hi,

    I have a plugin in which the html files are bundled. I followed your steps and could open the html file through plugin jar. But there are some images embedded in those html files which are not showing up. I couldnt get the concept of packing and unpacking which you have told in your previous comment. Please suggest me how to get images in the html file.

    Thanks and Regards,
    Rupa
  • garethj · 3 months ago
    Hi Rupa,

    Unfortunately I've not done this myself but it appears from Chris' comments above that he did. Sounds like you need to tick the option that unpacks your plugin when installed (in feature.xml). I assume this means that it unzip the installed JAR file rather than leaving it in the eclipse directory as-is. Good luck!

    Gareth
  • rupa · 3 months ago
    Hi Gareth,

    Thank you very much for your response. But I could not find anything in my plugin.xml (Guessing that Chris' feature.xml is my plugin.xml) to unpack the jar during install. I guess the problem for not displaying the image in html files is that the html file is read to cache by toFileURL() method and the file contents are read and its not able to find the image there. I have to fix it somehow as the dead line is nearby. Anyways, please let me know if you find out any way to sort out this problem.
    Thanks,
    Rupa