<?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>Modular Mind &#187; Tutorial</title>
	<atom:link href="http://www.modumind.com/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.modumind.com</link>
	<description>Eclipse RCP and OSGi training - online or onsite</description>
	<lastBuildDate>Thu, 18 Feb 2010 19:07:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Logging RCP applications with Pax Logging</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/</link>
		<comments>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 16:20:21 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://rcpquickstart.com/?p=568</guid>
		<description><![CDATA[Adding logging to an RCP application has always been painful. Developers have struggled with the best way to incorporate Log4J and other logging APIs, and in particular with how to make configuration files accessible. Some have chosen to use buddy classloading, others have utilized fragments containing the config files.
Pax Logging to the rescue
I&#8217;m happy to [...]]]></description>
			<content:encoded><![CDATA[<p>Adding logging to an RCP application has always been painful. Developers have struggled with the best way to incorporate Log4J and other logging APIs, and in particular with how to make configuration files accessible. Some have chosen to use buddy classloading, others have utilized fragments containing the config files.</p>
<p><strong>Pax Logging to the rescue</strong></p>
<p>I&#8217;m happy to say that RCP developers now have another choice - <a href="http://wiki.ops4j.org/display/paxlogging/Pax+Logging">Pax Logging</a>. There are a few great things about this library:</p>
<ul>
<li>Installation is easy. I&#8217;ll describe this in a bit.</li>
<li>Configuration files can be placed in regular folders, either inside of an application bundle or anywhere on a users machine.</li>
<li>Many logging APIs are supported, including Log4J, Commons Logging, JDK Logging, SLF4J and more. This means that legacy and third-party code can run as-is no matter what logging API they use.</li>
</ul>
<p><strong>Logging configuration with Pax ConfMan</strong></p>
<p>Because Pax Logging requires the OSGi Configuration Admin service to work, your first step is to install this service in the form of Pax ConfMan. In <a href="/2009/07/10/configuring-rcp-applications-with-pax-confman/">my last blog post</a> I provided detailed instructions on how to do this.</p>
<p><strong>Adding configuration settings</strong></p>
<p>The good news is that once you install Pax ConfMan, you&#8217;re almost done! Pax ConfMan requires the Pax Logging bundles in order to work, so we only have a few minor steps left.</p>
<p>The first is to add a logging configuration file. When using the OSGi Configuration Admin service, services are identified using a <em>persistent identifier</em>, or <em>PID</em>. Developers can choose the PIDs for their own services, and an implementation of the Config Admin uses these PIDs to inject properties into services.</p>
<p>Pax ConfMan does this by requiring that a properties file be named based on the PID of the service it is going to configure. For example, the Pax Logging PID is <code>org.ops4j.pax.logging</code> and so the properties file for this service will be called <code>org.ops4j.pax.logging.properties</code>.</p>
<p>If you created the folder structure suggested in the Pax ConfMan setup, simply create a file called <code>org.ops4j.pax.logging.properties</code> in the <code>confadmin/services</code> directory. You can now place whatever logging configuration you like into this file. For instance, here&#8217;s what I have for my simple test project:<br />
<code><br />
log4j.rootLogger=DEBUG, A1</code></p>
<p><code> </code></p>
<p><code>log4j.appender.A1=org.apache.log4j.ConsoleAppender<br />
log4j.appender.A1.layout=org.apache.log4j.PatternLayout<br />
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n</code></p>
<p><code> </code></p>
<p><code>log4j.logger.com.rcpquickstart.logtest=DEBUG<br />
</code></p>
<p><strong>Forcing Pax Logging to start</strong></p>
<p>Just as we did with Pax ConfMan, its necessary to force Pax Logging to start up when our application is launched. To do this, we simply need add the <code>org.ops4j.pax.logging.pax-logging-service</code> bundle to the Configuration page of the Product Configuration Editor and set it&#8217;s <code>Auto-Start</code> property to <code>true</code>. If you&#8217;ve followed the instructions for installing Pax ConfMan, your complete list should look like this:</p>
<p><img class="aligncenter size-full wp-image-577" title="paxlogging-1" src="/wp-content/uploads/2009/07/paxlogging-12.png" alt="paxlogging-1" width="450" height="204" /></p>
<p><strong>Fire it up</strong></p>
<p><strong><span style="font-weight:normal;">That&#8217;s all there is to it. Start up your RCP application and you should see log messages appear in your console. </span></strong></p>
<p><strong><span style="font-weight:normal;"><img class="aligncenter size-full wp-image-578" title="paxlogging-2" src="/wp-content/uploads/2009/07/paxlogging-2.png" alt="paxlogging-2" width="450" height="273" /></span></strong></p>
<p>Happy logging!</p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2009%2F07%2F14%2Flogging-rcp-applications-with-pax-logging%2F&amp;linkname=Logging%20RCP%20applications%20with%20Pax%20Logging">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adding Help to Eclipse 3.3 RCP Applications</title>
		<link>http://www.modumind.com/2007/12/13/adding-help-to-eclipse-33-rcp-applications/</link>
		<comments>http://www.modumind.com/2007/12/13/adding-help-to-eclipse-33-rcp-applications/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 20:45:20 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/12/13/adding-help-to-eclipse-33-rcp-applications/</guid>
		<description><![CDATA[The Eclipse help system changed dramatically in Eclipse 3.3, and it requires a new set of plug-ins to work correctly. There is little documentation about how to include the help system in an RCP application, though Kai Tödter was kind of enough to post a list of the correct help system plug-ins. 
I&#8217;ve taken that list and [...]]]></description>
			<content:encoded><![CDATA[<p>The Eclipse help system changed dramatically in Eclipse 3.3, and it requires a new set of plug-ins to work correctly. There is little documentation about how to include the help system in an RCP application, though Kai Tödter was kind of enough to post<a href="http://toedter.com/blog/?p=8"> a list of the correct help system plug-ins</a>. </p>
<p>I&#8217;ve taken that list and pared it down a bit (the Ant plug-ins are not necessary), and created a simple working example of an RCP app with integrated help. The example wraps the Eclipse help system in a feature called <code>org.eclipse.help</code>, which you can reuse in your own applications. There is <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=202160">some talk about making the help system an official feature in Eclipse 3.4</a>, but for now the included feature should get you what you need. You&#8217;ll of course need to add the required plug-ins to your target platform, and if you&#8217;re curious, this is the final list:  </p>
<p><img src="/wp-content/uploads/2007/12/help-feature-plugins.png" alt="List of Plug-ins for Eclipse 3.3 Help System" />  </p>
<p>To get started, just <a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/rcp33-help-example.zip">download the example projects</a> and import them into your workspace.</p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F12%2F13%2Fadding-help-to-eclipse-33-rcp-applications%2F&amp;linkname=Adding%20Help%20to%20Eclipse%203.3%20RCP%20Applications">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2007/12/13/adding-help-to-eclipse-33-rcp-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting started with PDE Build</title>
		<link>http://www.modumind.com/2007/06/06/getting-started-with-pde-build/</link>
		<comments>http://www.modumind.com/2007/06/06/getting-started-with-pde-build/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 17:10:28 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Builds]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/06/getting-started-with-pde-build/</guid>
		<description><![CDATA[I often work with teams getting started with Eclipse RCP, and the most common complaint I hear is that it&#8217;s too hard to set up automated builds. PDE Build can be frustrating to work with because it&#8217;s a black box. Your code goes in one side and a fully branded RCP application pops out the [...]]]></description>
			<content:encoded><![CDATA[<p>I often work with teams getting started with Eclipse RCP, and the most common complaint I hear is that it&#8217;s too hard to set up automated builds. PDE Build can be frustrating to work with because it&#8217;s a black box. Your code goes in one side and a fully branded RCP application pops out the other. But if something goes wrong inside the box, where do you start to debug?</p>
<p>In my opinion, the best way to work with PDE Build is to get a very simple build running in your environment. Then make small, incremental additions, verifying the integrity of the process after each change. So the immediate problem for a team becomes: <em>How do I get that first build running?</em></p>
<p>To help with this, I&#8217;ve put together a simple feature-based RCP product build. Just <a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/pdebuild-tutorial-1.zip">download</a> and import the sample projects. If you follow the instructions in the included <code>readme.txt</code> file, you should have a build running fairly quickly. Before you know it, you&#8217;ll be seeing that always elusive <code>BUILD SUCCESSFUL</code> message flash across your screen!</p>
<p><em>Note: If you want to run this sample build using Eclipse 3.2, you&#8217;ll need to work around a PDE Build <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=152577">defect</a>. For instructions on how to do this, check out the &#8220;Problems parsing feature file in a product build&#8221; section on the <a href="http://wiki.eclipse.org/index.php/PDEBuild">PDE Build wiki page</a>.</em></p>
<p><em>Update &#8211; October 6, 2009: The sample projects have now been updated to work with Eclipse 3.5.1</em></p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2007/06/06/getting-started-with-pde-build/feed/</wfw:commentRss>
		<slash:comments>279</slash:comments>
		</item>
		<item>
		<title>Common Navigator Tutorial 1: Hello World</title>
		<link>http://www.modumind.com/2007/04/25/common-navigator-tutorial-1-hello-world/</link>
		<comments>http://www.modumind.com/2007/04/25/common-navigator-tutorial-1-hello-world/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 21:34:28 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/04/25/common-navigator-tutorial-1-hello-world/</guid>
		<description><![CDATA[The Commons Navigator Framework is one of the more complex parts of the Eclipse API. It can be difficult to get started with the framework, and one of the hardest parts is simply getting a basic navigator to appear with custom content. This tutorial is designed to get you to that point so that you [...]]]></description>
			<content:encoded><![CDATA[<p>The Commons Navigator Framework is one of the more complex parts of the Eclipse API. It can be difficult to get started with the framework, and one of the hardest parts is simply getting a basic navigator to appear with custom content. This tutorial is designed to get you to that point so that you can start exploring the framework on your own.</p>
<p>There are quite a few steps, but it&#8217;s not as bad as it looks. So let&#8217;s get started!</p>
<p><span id="more-22"></span></p>
<ul>
<li>Before creating a navigator, it&#8217;s first necessary to have something to place it in. If you don&#8217;t have an existing RCP application to work with, create a new one using the &#8220;Hello RCP&#8221; template. Also, if you have a custom target platform, you&#8217;ll need to add the <code>org.eclipse.ui.navigator</code> plug-in to that target. Finally, you&#8217;ll need to add the navigator plug-in as a dependency in the appropriate manifest.</li>
</ul>
<ul>
<li>Now that the preparations are out of the way, we can create the navigator itself. Because CNF navigators are also regular views, the first step is to create an <code>org.eclipse.ui.views</code> extension. Enter in an appropriate <code>id</code> and <code>name</code>, and then enter a new class name in the <code>class</code> field. <em>Note that this is where we diverge from standard CNF usage. Normally we would simply enter the </em><code>org.eclipse.ui.navigator.CommonNavigator</code><em> class in this field. To learn why we are not, check out my <a href="/2007/04/20/using-the-common-navigator-framework-in-an-rcp-application/">previous post</a> on the subject.</em></li>
</ul>
<ul>
<li>Click on the <code>class</code> field label to launch the New Java Class wizard. Change the superclass to <code>org.eclipse.ui.navigator.CommonNavigator</code> and click <code>Finish</code>. We now have our main navigator class, and we&#8217;ll return to it a little later. You can now also add your view to a perspective either programmatically or through a perspective extension. At this point, you should be able to run your application and see an empty navigator appear.</li>
</ul>
<p><img src="/wp-content/uploads/2007/04/cnf-tutorial-1-1.png" alt="CNF Tutorial 1" /></p>
<ul>
<li>Now for some content. Create a <code>NavigatorRoot</code> class that will serve as the root node in your navigator. Note that this element will not appear in the navigator, the children of the root node will be the first to appear. The class representing the navigator root must be an <code>IAdaptable</code>, and the simplest way to accomplish this is to have your <code>NavigatorRoot</code> extend the <code>PlatformObject</code> class. Also create another simple bean called <code>ParentBean</code> that has a <code>name</code> attribute. Finally, add a <code>getParentBeans</code> method to your <code>NavigatorRoot</code> class and have that method return a set of  populated <code>ParentBean</code> instances.</li>
</ul>
<ul>
<li>The navigator root can now be added to the navigator class we created above. In that class, override the <code>getInitialInput</code> method and simply return a new instance of <code>NavigatorRoot</code>. Note that in a real-world implementation, the navigator root would probably be a singleton or returned by a factory class. Also note that these few lines of code are all that are required in the navigator subclass. While subclassing the CNF navigator is not ideal, this approach is far from risky.</li>
</ul>
<ul>
<li>The next step is to declare an <code>org.eclipse.ui.navigator.navigatorContent</code> extension. This extension point is used to define many navigator elements, including content (of course), filters and actions. It&#8217;s important to understand that this extension point defines content in a <em>navigator independent</em> way. You will later need to <em>bind</em> this content to a specific navigator to get the content to appear. So create this extension and add a <code>navigatorContent</code> element below it. Choose an appropriate <code>id</code> and <code>name</code>, and then enter class names for the <code>contentProvider</code> and <code>labelProvider</code> fields.</li>
</ul>
<ul>
<li>Click on the <code>contentProvider</code> and <code>labelProvider</code> field labels to create the required providers. The content provider should take in a <code>NavigatorRoot</code> as input and return an array of <code>ParentBean</code> instances as children. The label provider should simply return the name of the <code>ParentBean</code> as the display text.</li>
</ul>
<ul>
<li>We now need to specify what will cause our content to appear. The simplest way to do this is to specify what type of parent element should <em>trigger</em> our content and cause our content/label providers to be called. In our example, we&#8217;ll add a <code>triggerPoints</code> element below the <code>navigatorContent</code> element. Under <code>triggerPoints</code>, we&#8217;ll add an <code>instanceof</code> element and then enter your <code>NavigatorRoot</code> class in the <code>value</code> field. This will cause your content to be added whenever a <code>NavigatorRoot</code> instance is encountered in the tree.</li>
</ul>
<ul>
<li>The final step (we&#8217;re almost there!) is to bind the content to the navigator. To do that, we need to declare an <code>org.eclipse.ui.navigator.viewer</code> extension. This extension point registers our view as a navigator and allows us to bind different types of content to it. Create the extension and first add a <code>viewer</code> element to it. Enter the id of your view in the <code>viewerId</code> field. Now add a <code>viewerContentBinding</code> element below the extension. This element is what actually adds our content into the navigator. Again, enter your view id into the <code>viewerId</code> field. Add an <code>includes</code> element below the <code>viewerContentBinding</code> and then a <code>contentExtension</code> element below that. Finally, in the <code>pattern</code> field of the <code>contentExtension</code> element, enter the id of your navigator content.</li>
</ul>
<p>You should now be able to run your application and see content appear in the navigator!</p>
<p><img src="/wp-content/uploads/2007/04/cnf-tutorial-1-2.png" alt="CNF Tutorial 2" /></p>
<p>As you can see, even the simplest CNF example requires a fair number of steps to get working. It&#8217;s also rare for the navigator to appear correctly on the first try, and it can be extremely frustrating to debug the CNF when things go wrong. So much of the CNF is wired using extension points that any small typo can cause you a lot of grief. For that reason, I recommend that when working with the CNF you make small, incremental changes and verify functionality after each change.</p>
<p>Because it can be a real pain to get all the linkages working the first time, I&#8217;ve created some sample code (<a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/cnf-tutorial-1-eclipse32.zip">Eclipse 3.2</a>, <a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/cnf-tutorial-1-eclipse33.zip">Eclipse 3.3</a>) that will get you up to speed more quickly. Good luck!</p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F04%2F25%2Fcommon-navigator-tutorial-1-hello-world%2F&amp;linkname=Common%20Navigator%20Tutorial%201%3A%20Hello%20World">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2007/04/25/common-navigator-tutorial-1-hello-world/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
	</channel>
</rss>
