<?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>Developer Papercuts &#187; PDE</title>
	<atom:link href="http://www.vogella.de/blog/tag/pde/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vogella.de/blog</link>
	<description>Tips around Eclipse and Android programming</description>
	<lastBuildDate>Wed, 08 Feb 2012 17:31:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eclipse Papercut #7 &#8211; Adding the PDE Plugin creation wizard to the Eclipse toolbar</title>
		<link>http://www.vogella.de/blog/2011/01/13/eclipse-papercut-7-adding-the-pde-plugin-creation-wizard-to-the-eclipse-toolbar/</link>
		<comments>http://www.vogella.de/blog/2011/01/13/eclipse-papercut-7-adding-the-pde-plugin-creation-wizard-to-the-eclipse-toolbar/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 05:39:56 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Papercut]]></category>
		<category><![CDATA[PDE]]></category>
		<category><![CDATA[Plug-in]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=3732</guid>
		<description><![CDATA[Its been a while since I wrote my last Eclipse papercut blog entry.

Today I demonstrate how to add the PDE wizard for creating new plugins to the Eclipse toolbar. I personally create plugin projects on a regular basis therefore it is annoying to select the wizard via File-&#62; New -&#62; blablabla.

I know that I ...]]></description>
			<content:encoded><![CDATA[<p>Its been a while since I wrote my last <a href="http://www.vogella.de/blog/category/papercut/">Eclipse papercut</a> blog entry.</p>
<p>Today I demonstrate how to add the PDE wizard for creating new <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html">plugins</a> to the Eclipse toolbar. I personally create plugin projects on a regular basis therefore it is annoying to select the wizard via File-&gt; New -&gt; blablabla.</p>
<p>I know that I can use Ctrl+3 to select the wizard but I want to be able to select this wizard from the main toolbar. </p>
<p>This is really easily. First find the related Wizard via the <a href="http://www.vogella.de/articles/EclipseCodeAccess/article.html#pluginspy_ui">Plugin Spy</a>. We see that the wizard is called NewPluginProjectWizard.</p>
<p>Then create a <a href="http://www.vogella.de/articles/EclipseCommands/article.html">command</a> with the following default handler.</p>
<pre class="brush: plain; title: ; notranslate">

package de.vogella.plugin.pdewizard.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;

public class SampleHandler extends AbstractHandler {
	public Object execute(ExecutionEvent event) throws ExecutionException {
		Shell shell = HandlerUtil.getActiveShell(event);
		WizardDialog wizard = new WizardDialog(shell,
				new NewPluginProjectWizard());
		wizard.open();
		return null;
	}
}
</pre>
<p>Via the <a href="http://www.vogella.de/articles/EclipseCodeAccess/article.html#pluginspy_menu">plugin menu spy</a> you also find quickly a nice place to put your new toolitem to <a href="http://www.vogella.de/articles/EclipseCommands/article.html#toolbar">the main toobar</a> </p>
<pre class="brush: plain; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;?eclipse version=&quot;3.4&quot;?&gt;
&lt;plugin&gt;
   &lt;extension
         point=&quot;org.eclipse.ui.commands&quot;&gt;
      &lt;command
            defaultHandler=&quot;de.vogella.plugin.pdewizard.handlers.NewPluginWizardHandler&quot;
            id=&quot;de.vogella.plugin.pdewizard.commands.pluginwizard&quot;
            name=&quot;New Plugin Wizard&quot;&gt;
      &lt;/command&gt;
   &lt;/extension&gt;
   &lt;extension
         id=&quot;toolbar:org.eclipse.ui.workbench.file?after=newWizardDropDown&quot;
         point=&quot;org.eclipse.ui.menus&quot;&gt;
      &lt;menuContribution
            locationURI=&quot;toolbar:org.eclipse.ui.workbench.file&quot;&gt;
            &lt;command
                  commandId=&quot;de.vogella.plugin.pdewizard.commands.pluginwizard&quot;
                  icon=&quot;icons/sample.gif&quot;
                  tooltip=&quot;Create new plugin&quot;&gt;
            &lt;/command&gt;
      &lt;/menuContribution&gt;
   &lt;/extension&gt;

&lt;/plugin&gt;
</pre>
<p>If you also add the dependencies to org.eclipse.ui, org.eclipse.pde.ui, org.eclipse.pde.ui.templates and org.eclipse.core.runtime then you should be able to create a new plugin project via your new button in the main toolbar. </p>
<p>I hope this help. You can <a href="http://www.twitter.com/vogella">follow me on Twitter</a>. </p>
<p>EDIT: A simpler solution was proposed by <a href="http://blog.hantsuki.org/">Remy Suen</a>: Since the new/import/export wizards are parameterized commands, the same effect can actually be achieved with pure XML.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;extension
id=&quot;toolbar:org.eclipse.ui.workbench.file?after=newWizardDropDown&quot;
point=&quot;org.eclipse.ui.menus&quot;&gt;
&lt;menuContribution
locationURI=&quot;toolbar:org.eclipse.ui.workbench.file&quot;&gt;
&lt;command
commandId=&quot;org.eclipse.ui.newWizard&quot;&gt;
&lt;parameter
name=&quot;newWizardId&quot;
value=&quot;org.eclipse.pde.ui.NewProjectWizard&quot;&gt;
&lt;/parameter&gt;
&lt;/command&gt;
&lt;/menuContribution&gt;
&lt;/extension&gt;
</pre>
<p class="wp-flattr-button"></p> <p><a href="http://www.vogella.de/blog/?flattrss_redirect&amp;id=3732&amp;md5=085102e12f6265877e50ecfe82220a1b" title="Flattr" target="_blank"><img src="http://www.vogella.de/blog/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2011/01/13/eclipse-papercut-7-adding-the-pde-plugin-creation-wizard-to-the-eclipse-toolbar/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Eclipse projects &#8211; The nature of things</title>
		<link>http://www.vogella.de/blog/2010/06/08/eclipse-projects-nature/</link>
		<comments>http://www.vogella.de/blog/2010/06/08/eclipse-projects-nature/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 10:01:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[PDE]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2653</guid>
		<description><![CDATA[Did you ever wounder what defines if a project is "pure" Java project or a Plugin project? 



Have a look at the  ".project" file. This file contains the description of your project. It contains a XML tag "natures" where the nature of the project is described. A plugin project has the nature "org.eclipse.pde.PluginNature" ...]]></description>
			<content:encoded><![CDATA[<p>Did you ever wounder what defines if a project is &#8220;pure&#8221; Java project or a Plugin project? </p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/05/nature10.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/05/nature10-261x300.gif" alt="" title="nature10" width="261" height="300" class="alignnone size-medium wp-image-2655" /></a></p>
<p>Have a look at the  &#8220;.project&#8221; file. This file contains the description of your project. It contains a XML tag &#8220;natures&#8221; where the nature of the project is described. A plugin project has the nature &#8220;org.eclipse.pde.PluginNature&#8221; and a java project has the nature &#8220;org.eclipse.jdt.core.javanature&#8221;. </p>
<p>These tags will also steer some behavior of the development environment, e.g. a project with PluginNature will update the java class path if you change the dependency information in a plugin project. For example if you add the &#8220;org.eclipse.pde.PluginNature&#8221;  to an existing Java project you get the PDE menu for your project.</p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/05/nature20.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/05/nature20-300x94.gif" alt="" title="nature20" width="300" height="94" class="alignnone size-medium wp-image-2657" /></a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2010/06/08/eclipse-projects-nature/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting the plugin which defines an extension point.</title>
		<link>http://www.vogella.de/blog/2010/05/18/getting-the-plugin-which-defines-an-extension-point/</link>
		<comments>http://www.vogella.de/blog/2010/05/18/getting-the-plugin-which-defines-an-extension-point/#comments</comments>
		<pubDate>Tue, 18 May 2010 07:56:10 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[PDE]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2538</guid>
		<description><![CDATA[If you are like me you still use the Search dialog for plugins to find the definition plugin of an extension point.



I just realized that the Open Plugin Artifact Dialog (Ctrl+Shift+A) allows much faster access.



I also added the shortcut and a description to my Eclipse Source Code - Tutorial.]]></description>
			<content:encoded><![CDATA[<p>If you are like me you still use the Search dialog for plugins to find the definition plugin of an extension point.</p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/05/opa02.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/05/opa02-150x150.gif" alt="" width="150" height="150" class="aligncenter size-thumbnail wp-image-2539" /></a></p>
<p>I just realized that the Open Plugin Artifact Dialog (Ctrl+Shift+A) allows much faster access.</p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/05/opa10.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/05/opa10-150x150.gif" alt="" width="150" height="150" class="aligncenter size-thumbnail wp-image-2540" /></a></p>
<p>I also added the shortcut and a description to my <a href="http://www.vogella.de/articles/EclipseCodeAccess/article.html">Eclipse Source Code &#8211; Tutorial</a>.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2010/05/18/getting-the-plugin-which-defines-an-extension-point/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Eclipse PDE templates &#8211; Your action is my command</title>
		<link>http://www.vogella.de/blog/2009/09/23/pde-templates-commands/</link>
		<comments>http://www.vogella.de/blog/2009/09/23/pde-templates-commands/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 22:10:37 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[PDE]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[RCP]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=1153</guid>
		<description><![CDATA[The Eclipse PDE templates are fantastic to help people to learn the platform and to get oven the first initial resistence to start with Eclipse RCP  or Eclipse Plugin development.

Templates indicates to their consumers that they represent best development practices. This puts a certain burden on the quality to the templates. Unfortunately the ...]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.eclipse.org/pde/">Eclipse PDE</a> templates are fantastic to help people to learn the platform and to get oven the first initial resistence to start with <a href="http://www.vogella.de/articles/RichClientPlatform/article.html">Eclipse RCP </a> or <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html">Eclipse Plugin</a> development.</p>
<p>Templates indicates to their consumers that they represent best development practices. This puts a certain burden on the quality to the templates. Unfortunately the PDE RCP templates in Eclipse 3.5 were all based on actions which I believe are superseded by <a href="http://www.vogella.de/articles/EclipseCommands/article.html">Eclipse Commands</a>.</p>
<p>I have seen in the past lots of questions regarding actions in the Eclipse RCP and PDE newsgroups. I believe that at least some of these questions are based on the fact that the PDE templates still promote actions.</p>
<p>I&#8217;m therefore happy to see the changes of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=265231"> Bug 265231</a> applied for the &#8220;RCP with a view&#8221; template for the upcoming Eclipse 3.6.  Special thanks for this to <a href="http://aniszczyk.org/">Chris Aniszczyk</a>.</p>
<p>It also looks good for the mail example. It seems that work is happening in <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=253105"> Bug 253105</a></p>
<p>Actions are (a little bit more) dead. Long live the command! <img src='http://www.vogella.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2009/09/23/pde-templates-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Papercut #4 &#8211; Modifying Eclipse PDE default launch configuration</title>
		<link>http://www.vogella.de/blog/2009/07/27/modify-eclipse-pde-code/</link>
		<comments>http://www.vogella.de/blog/2009/07/27/modify-eclipse-pde-code/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 09:29:27 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Papercut]]></category>
		<category><![CDATA[PDE]]></category>
		<category><![CDATA[Planet]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=603</guid>
		<description><![CDATA[Explains how to change the default PDE launch configuration. Demonstrates how to get and modify Eclipse PDE code.]]></description>
			<content:encoded><![CDATA[<p>In this episode of the <a href="http://www.vogella.de/blog/category/papercut/"> Eclipse Papercut series </a> I will change the default PDE launch configuration. During this process I show how to get and modify Eclipse PDE code.</p>
<p>Lets define the papercut: </p>
<p>One thing I always have to do during <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html">plugin </a>and <a href="http://www.vogella.de/articles/RichClientPlatform/article.html">Eclipse RCP</a> development is to make the following settings in the launch configuration:</p>
<ol>
<li><a href="http://www.vogella.de/articles/RichClientPlatform/article.html#runconfiguration_parameters">add -consoleLog in the arguments tab </a></li>
<li><a href="http://www.vogella.de/articles/RichClientPlatform/article.html#runconfiguration_check">Select the flag &#8220;Validate plug-in automatically prio to launching&#8221; on the plug-ins tab</a></li>
</ol>
<p>This papercut has two dimensions. </p>
<p>The first one is that for everybody who knows about these settings it is not a problem to set them up. It is just time-consuming and error prone. Sometimes I&#8217;m searching why something does not work and then I&#8217;m banging my head because I forgot to set -consoleLog.</p>
<p>The second dimension is that this default launch configuration makes it harder for new plugin and Eclipse RCP developers to get started. I frequently see questions in the Eclipse newsgroup and other places which can be answered by: &#8220;please set -consoleLog&#8221; or &#8220;press the Validate button&#8221;.</p>
<p>So I seek to change the current behavior.</p>
<p>Adding &#8220;-consoleLog&#8221; is easy. Go to preference, select the target platform, select &#8220;Edit&#8221; and add -consoleLog as a argument. </p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2009/07/target10.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2009/07/target10.gif" alt="target10" width="655" height="421" class="alignnone size-full wp-image-647" /></a></p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2009/07/target20.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2009/07/target20.gif" alt="target20" width="664" height="294" class="alignnone size-full wp-image-648" /></a></p>
<p>Of course this does not help the new developers but I come back to this later in this post.</p>
<p>To set the &#8220;Validate plug-in automatically prio to launching&#8221; flag we have to look into Eclipse PDE code. </p>
<p>A launch configuration is contributed by the extension point &#8220;org.eclipse.debug.core.launchConfigurationTypes&#8221;. To search through your existing plugins <a href="http://www.vogella.de/articles/EclipseCodeAccess/article.html#importplugins">import your plugins into a new workspace</a>. A <a href="http://www.vogella.de/articles/EclipseCodeAccess/article.html#search_plugin">plugin search</a> reveals that &#8220;org.eclipse.pde.ui&#8221; contributes such an extension.</p>
<p>Eclipse PDE can be found in the <a href="http://wiki.eclipse.org/index.php/CVS_Howto">Eclipse cvs</a> via the repository path &#8220;/cvsroot/eclipse&#8221;. Search here for the folder &#8220;pde&#8221; which contains the pde plugins. Checkout the plugin &#8220;org.eclipse.pde.ui&#8221;. </p>
<p>Here we find quickly the right extension point.</p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2009/07/pde10.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2009/07/pde10-300x133.gif" alt="pde10" width="300" height="133" class="alignnone size-medium wp-image-656" /></a></p>
<p>After some pocking around the code and some <a href="http://www.vogella.de/articles/EclipseDebugging/article.html">debugging </a> I found the class &#8220;AbstractPluginBlock&#8221; and the method &#8220;setDefaults&#8221;. The change is trivial:</p>
<pre class="brush: java; title: ; notranslate">
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
	config.setAttribute(IPDELauncherConstants.INCLUDE_OPTIONAL, true);
	config.setAttribute(IPDELauncherConstants.AUTOMATIC_ADD, true);
	config.setAttribute(IPDELauncherConstants.AUTOMATIC_VALIDATE, true); // This has changed from false to true
	config.setAttribute(IPDELauncherConstants.SHOW_SELECTED_ONLY, false);
}
</pre>
<p>If you now run Eclipse with this adjusted plugin the flag &#8220;Validate&#8230;&#8221; will be flagged for a new runtime configuration. </p>
<p>Now lets return to the addtion of &#8220;-consoleLog&#8221; to the target platform. I argued earlier that the absence of &#8220;-consoleLog&#8221; makes it harder for beginner to get started with plugin and RCP development. Changing the target platform is not trivial for starters, so the better solution was if was part of the standard code. </p>
<p>We find the relevant code easily with a text seach for an existing launch parameter, e.g. &#8220;-arch&#8221;. The responsible class is &#8220;LaunchArgumentsHelper&#8221; and the method getInitialProgramArguments(). We add &#8220;-consoleLog&#8221; to the following line:</p>
<pre class="brush: java; title: ; notranslate">

StringBuffer buffer = new StringBuffer(&quot;-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog&quot;); //$NON-NLS-1$
</pre>
<p>Thats it. By <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html#deployplugin">deploying the plugin </a>into our Eclipse IDE we have the changed behavior.</p>
<p>I have submitted bugs and attached the patches. <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=272076">Bug Report for &#8220;Validate plug-in automatically prio to launching&#8221;</a> and <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=284704"> Bug Report for -consoleLog</a>.</p>
<p>I hope that these patches will get accepted. If they would be accepted I believe it would be a little easier for new developers to get started.</p>
<p>If someone finds a reason why these settings should not always be the default I would suggest a new PDE <a href="http://www.vogella.de/articles/EclipsePreferences/article.html"> preference page</a> which contains the settings for these launch parameters. </p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2009/07/27/modify-eclipse-pde-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

