Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Showing Local URLs in Browser
Showing Local URLs in Browser [message #911377] Tue, 11 September 2012 13:26 Go to next message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
Hi everyone!

Two really short questions:

First off I can't find any documentation stating why
		Browser browser = new Browser(parent, SWT.NONE);
		browser.setUrl("file:///C:/index.html"); // returns true

won't work. I know it seems silly, but I am creating a help system and it would be nice to have access to local HTML files for development. Does anyone know something?

Secondly I have a general problem with accessing files inside plug-ins. I have a dedicated RAP plug-in with the Eclipse Help data. I am able to access these files with the bundle and read them with a InputStream, but advanced functions (like HTML anchors and pictures) of course won't work that way. Is there any way to access these files by URL?

Thanks in advance,

S. Schulz
Re: Showing Local URLs in Browser [message #911480 is a reply to message #911377] Tue, 11 September 2012 17:36 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
You can read this FAQ to register your local resource.

http://wiki.eclipse.org/RAP/FAQ#How_to_register_a_file.2Ffolder_as_resource.3F

Put the folder, say "help", inside a bundle, then register it as a resource. Then you can use the browser widgit and create the URL in this format:

"http://{0}:{1}/help/index.html";


while

{0} = RWT.getRequest().getServerName()
{1} = String.valueOf(RWT.getRequest().getServerPort()

HTH,
Ronald
Re: Showing Local URLs in Browser [message #911676 is a reply to message #911377] Wed, 12 September 2012 05:38 Go to previous message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
Thank you, that worked.
Previous Topic:Session failover for workbench planned?
Next Topic:Virtual tree viewer reinserts orphaned items
Goto Forum:
  


Current Time: Sat Apr 20 00:19:39 GMT 2024

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

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

Back to the top