<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gareth Jones &#187; java</title>
	<atom:link href="http://blog.garethj.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.garethj.com</link>
	<description></description>
	<lastBuildDate>Mon, 09 Aug 2010 10:35:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SWT browser widgets and local plugin files</title>
		<link>http://blog.garethj.com/2008/03/swt-browser-widgets-and-local-plugin-files/</link>
		<comments>http://blog.garethj.com/2008/03/swt-browser-widgets-and-local-plugin-files/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 16:13:16 +0000</pubDate>
		<dc:creator>gareth</dc:creator>
				<category><![CDATA[techy solutions]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swt]]></category>

		<guid isPermaLink="false">http://blog.garethj.com/2008/03/11/swt-browser-widgets-and-local-plugin-files/</guid>
		<description><![CDATA[Ok, getting very technical from my normal postings but I found this really difficult to track down so thought it was worth posting somewhere. I&#8217;ve creating an application inside the Eclipse framework and wanted to write some HTML and display &#8230; <a href="http://blog.garethj.com/2008/03/swt-browser-widgets-and-local-plugin-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ok, getting very technical from my normal postings but I found this really difficult to track down so thought it was worth posting somewhere. I&#8217;ve creating an application inside the Eclipse framework and wanted to write some HTML and display inside the SWT browser widget. It&#8217;s pretty easy to do this with files elsewhere, you simply give the browser widget a URL. However, if you want to load stuff from a local project it turns out to be a bit less obvious (technically this applies to getting access to any files from within an Eclipse project at runtime). So&#8230; in great anticipation I&#8217;m sure &#8211; here&#8217;s the code:<br />
<code><br />
Browser browser = new Browser(parent, SWT.NONE);<br />
Bundle plugin = Activator.getDefault().getBundle(); // Where Activator is my org.eclipse.core.runtime.Plugin<br />
IPath relativePagePath = new Path("html/index.html");<br />
URL fileInPlugin = FileLocator.find(plugin, relativePagePath, null);<br />
URL pageUrl = FileLocator.toFileURL(fileInPlugin);<br />
browser.setUrl(pageUrl.toString());<br />
</code></p>
<p>Easy when you know how.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.garethj.com/2008/03/swt-browser-widgets-and-local-plugin-files/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
