<?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; Plugin</title>
	<atom:link href="http://www.vogella.de/blog/tag/plugin/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>Shortcuts for Next / Previous result in the Search View</title>
		<link>http://www.vogella.de/blog/2010/11/16/next-previous-search-shortcut/</link>
		<comments>http://www.vogella.de/blog/2010/11/16/next-previous-search-shortcut/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 09:44:00 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=3336</guid>
		<description><![CDATA[Paul Webster posted a very nice small Eclipse plugin to support Tor Norby from the Javaposse. 

This plugin defines a command which defines shortcuts to navigate through the search results in the search view, even if the search view doesn't have the focus. 

I find such a plugin very useful therefore I decided to ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://pweclipse.blogspot.com/">Paul Webster</a> posted a very nice small <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html">Eclipse plugin</a> to support <a href="http://tornorbye.blogspot.com/2010/10/android.html">Tor Norby</a> from the <a href="http://javaposse.com/">Javaposse</a>. </p>
<p>This plugin defines a <a href="http://www.vogella.de/articles/EclipseCommands/article.html">command</a> which defines <a href="http://www.vogella.de/articles/EclipseShortcuts/article.html">shortcuts</a> to navigate through the search results in the search view, even if the search view doesn&#8217;t have the focus. </p>
<p>I find such a plugin very useful therefore I decided to &#8220;re-blog&#8221; <img src='http://www.vogella.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Pauls code. Here is the coding and the plugin.xml.</p>
<pre class="brush: plain; title: ; notranslate">
package z.ex.search;

import java.util.HashMap;

public class NextPrevSearchEntryHandler extends AbstractHandler implements IExecutableExtension {
	private String searchCommand = IWorkbenchCommandConstants.NAVIGATE_NEXT;

	public Object execute(ExecutionEvent event) throws ExecutionException {
		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
		ICommandService cs = (ICommandService) window.getService(ICommandService.class);

		Command showView = cs.getCommand(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW);
		HashMap&lt;String, Object&gt; parms = new HashMap&lt;String, Object&gt;();
		parms.put(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_ID, &quot;org.eclipse.search.ui.views.SearchView&quot;);
		ParameterizedCommand showSearchView = ParameterizedCommand.generateCommand(showView, parms);

		IHandlerService hs = (IHandlerService) window.getService(IHandlerService.class);
		try {
			hs.executeCommand(showSearchView, (Event)event.getTrigger());
			hs.executeCommand(searchCommand, (Event)event.getTrigger());
			hs.executeCommand(IWorkbenchCommandConstants.WINDOW_ACTIVATE_EDITOR, (Event)event.getTrigger());
		} catch (NotDefinedException e) {
			throw new ExecutionException(e.getMessage(), e);
		} catch (NotEnabledException e) {
			throw new ExecutionException(e.getMessage(), e);
		} catch (NotHandledException e) {
			throw new ExecutionException(e.getMessage(), e);
		}

		return null;
	}

	public void setInitializationData(IConfigurationElement config,
			String propertyName, Object data) throws CoreException {
		if (&quot;previous&quot;.equals(data)) {
			searchCommand = IWorkbenchCommandConstants.NAVIGATE_PREVIOUS;
		}
	}

}
</pre>
<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
            categoryId=&quot;org.eclipse.ui.category.navigate&quot;
            defaultHandler=&quot;z.ex.search.NextPrevSearchEntryHandler:next&quot;
            id=&quot;z.ex.search.nextSearchEntry&quot;
            name=&quot;Next Search Entry&quot;&gt;
      &lt;/command&gt;
      &lt;command
            categoryId=&quot;org.eclipse.ui.category.navigate&quot;
            defaultHandler=&quot;z.ex.search.NextPrevSearchEntryHandler:previous&quot;
            id=&quot;z.ex.search.prevSearchEntry&quot;
            name=&quot;Previous Search Entry&quot;&gt;
      &lt;/command&gt;
   &lt;/extension&gt;
   &lt;extension
         point=&quot;org.eclipse.ui.bindings&quot;&gt;
      &lt;key
            commandId=&quot;z.ex.search.nextSearchEntry&quot;
            contextId=&quot;org.eclipse.ui.contexts.window&quot;
            schemeId=&quot;org.eclipse.ui.defaultAcceleratorConfiguration&quot;
            sequence=&quot;ALT+.&quot;&gt;
      &lt;/key&gt;
      &lt;key
            commandId=&quot;z.ex.search.prevSearchEntry&quot;
            contextId=&quot;org.eclipse.ui.contexts.window&quot;
            schemeId=&quot;org.eclipse.ui.defaultAcceleratorConfiguration&quot;
            sequence=&quot;ALT+,&quot;&gt;
      &lt;/key&gt;
   &lt;/extension&gt;

&lt;/plugin&gt;
</pre>
<p>I think it would be cool to have this in standard Eclipse. If you agree <strong>please place your opinion in the bug report from Paul: <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=328460">Bug Report</a></strong>.</p>
<p>Thanks <a href="http://pweclipse.blogspot.com/">Paul</a>, I hope it is ok to blog about your development. </p>
<p>If you are located in Germany you may be interested in my <a href="http://www.vogella.de/training/eclipsercp.html">Eclipse RCP training</a> which I deliver together with <a href="http://www.ralfebert.de/">Ralf Ebert</a>. </p>
<p class="wp-flattr-button"></p> <p><a href="http://www.vogella.de/blog/?flattrss_redirect&amp;id=3336&amp;md5=7297dcd50366ffd11447f42b2bd50da9" 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/2010/11/16/next-previous-search-shortcut/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Eclipse Development &#8211; In which plugin do I find this class?</title>
		<link>http://www.vogella.de/blog/2010/09/28/plugin-for-class/</link>
		<comments>http://www.vogella.de/blog/2010/09/28/plugin-for-class/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 10:24:24 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[RCP]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=3186</guid>
		<description><![CDATA[A common question for Eclipse Plugin or Eclipse RCP developer is in which plugin a certain class is included. 

A very easy way for finding this information is the Open Type Dialog (Hotkey Ctrl + Shift +T). Just look in the right bottom corner. 



Thanks for Ralf Ebert for reminding me that this is ...]]></description>
			<content:encoded><![CDATA[<p>A common question for <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html">Eclipse Plugin</a> or <a href="http://www.vogella.de/articles/EclipseRCP/article.html">Eclipse RCP</a> developer is in which plugin a certain class is included. </p>
<p>A very easy way for finding this information is the Open Type Dialog (Hotkey Ctrl + Shift +T). Just look in the right bottom corner. </p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/09/pluginforclass.png"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/09/pluginforclass.png" alt="" width="630" height="344" class="aligncenter size-full wp-image-3189" /></a></p>
<p>Thanks for <a href="http://www.ralfebert.de/">Ralf Ebert</a> for reminding me that this is a common problem. </p>
<p class="wp-flattr-button"></p> <p><a href="http://www.vogella.de/blog/?flattrss_redirect&amp;id=3186&amp;md5=97bbc5a3e0a2ab2f72365d9810e34d09" 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/2010/09/28/plugin-for-class/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using Eclipse Templates to show off</title>
		<link>http://www.vogella.de/blog/2010/09/14/eclipse-templates/</link>
		<comments>http://www.vogella.de/blog/2010/09/14/eclipse-templates/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 07:51:42 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[RCP]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=3109</guid>
		<description><![CDATA[Have you ever been in a software demo there the presenter was that fast with the editor that you were scared?



He might have been using personal templates. Templates allow you to save a block of coding and insert it as you desire. You find them under Window-&#62; Preferences -&#62; Java -&#62; Editor -&#62; Templates.

Try ...]]></description>
			<content:encoded><![CDATA[<p>Have you ever been in a software demo there the presenter was that fast with the editor that you were scared?</p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/09/cool.png"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/09/cool.png" alt="" width="200" height="100" class="aligncenter size-full wp-image-3163" /></a></p>
<p>He might have been using personal templates. Templates allow you to save a block of coding and insert it as you desire. You find them under Window-&gt; Preferences -&gt; Java -&gt; Editor -&gt; Templates.</p>
<p>Try it out in the Editor for the SWT templates (within an <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html">Eclipse plugin</a> or <a href="http://www.vogella.de/articles/EclipseRCP/article.html">Eclipse RCP application</a>). Type Label and press Cntr+Space three times until you see only the Java template suggestions.</p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/09/templates10.png"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/09/templates10.png" alt="" width="807" height="121" class="aligncenter size-full wp-image-3111" /></a></p>
<p>Select the template and change the code to your liking. Do the same for GridData. You end up the following code almost without typing. </p>
<pre class="brush: plain; title: ; notranslate">
Label label1 = new Label(parent, SWT.NONE);
label1.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false,false));
label1.setText(&quot;Test&quot;);
GridData gridData2 = new GridData(SWT.FILL, SWT.FILL, true, false);
gridData2.widthHint = SWT.DEFAULT;
gridData2.heightHint = SWT.DEFAULT;
label1.setLayoutData(gridData2);
</pre>
<p>The great thing about templates is that you can define your own once. So if you have something longer which you need to type again and again you can use your own templates. </p>
<p class="wp-flattr-button"></p> <p><a href="http://www.vogella.de/blog/?flattrss_redirect&amp;id=3109&amp;md5=eff11fcdfa5c9bc86c1e8fa9a6d3c66a" 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/2010/09/14/eclipse-templates/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Reading resources from a Eclipse plugin</title>
		<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/</link>
		<comments>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 00:16:16 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2783</guid>
		<description><![CDATA[Frequenty you want to store static files in your bundle and load them from your bundle. For this you can use the following code, of course replace the bundle id with your version:



Alternatively you can also use URL directly. I have to thank Paul Webster for this tip. 



I believe the second option is ...]]></description>
			<content:encoded><![CDATA[<p>Frequenty you want to store static files in your bundle and load them from your bundle. For this you can use the following code, of course replace the bundle id with your version:</p>
<pre class="brush: java; title: ; notranslate">

Bundle bundle = Platform.getBundle(&quot;de.vogella.example.readfile&quot;);
URL fileURL = bundle.getEntry(&quot;files/test.txt&quot;);
File file = null;
try {
	file = new File(FileLocator.resolve(fileURL).toURI());
} catch (URISyntaxException e1) {
	e1.printStackTrace();
} catch (IOException e1) {
	e1.printStackTrace();
}
</pre>
<p>Alternatively you can also use URL directly. I have to thank <a href="http://pweclipse.blogspot.com/">Paul Webster</a> for this tip. </p>
<pre class="brush: java; title: ; notranslate">

URL url;
try {
        url = new URL(&quot;platform:/plugin/de.vogella.rcp.plugin.filereader/files/test.txt&quot;);
	InputStream inputStream = url.openConnection().getInputStream();
	BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
	String inputLine;

	while ((inputLine = in.readLine()) != null) {
		System.out.println(inputLine);
	}

	in.close();

} catch (IOException e) {
	e.printStackTrace();
}
</pre>
<p>I believe the second option is the better one, as you avoid a dependency to the class Platform. </p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Going plugin (from an OSGi bundle)</title>
		<link>http://www.vogella.de/blog/2010/03/12/converting-osgi-bundle-to-plugin/</link>
		<comments>http://www.vogella.de/blog/2010/03/12/converting-osgi-bundle-to-plugin/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 15:08:31 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2197</guid>
		<description><![CDATA[The Eclipse plugin creation wizard allows to create OSGi bundles or Eclipse plugins. 



The most notable difference is that the PDE plugin editor does not show the extension tab. 



I recently wanted to use an plugin extension in a project which I initially created based on OSGi; therefore I wanted to enable the "Extension" ...]]></description>
			<content:encoded><![CDATA[<p>The Eclipse plugin creation wizard allows to create OSGi bundles or Eclipse plugins. </p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/03/osgi1.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/03/osgi1.gif" alt="" width="496" height="602" class="aligncenter size-full wp-image-2201" /></a></p>
<p>The most notable difference is that the PDE plugin editor does not show the extension tab. </p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/03/osgi20.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/03/osgi20.gif" alt="" width="375" height="447" class="aligncenter size-full wp-image-2202" /></a></p>
<p>I recently wanted to use an plugin extension in a project which I initially created based on OSGi; therefore I wanted to enable the &#8220;Extension&#8221; and the &#8220;Extension Point&#8221; tab in the PDE editor.</p>
<p>To do this remove the line &#8220;pluginProject.extensions.false&#8221; from the file .settings/org.eclipse.pde.core.prefs. Re-open the &#8220;MANIFEST.MF&#8221; and the Extensions tab will show.</p>
<p><a href="http://www.vogella.de/blog/wp-content/uploads/2010/03/osgi301.gif"><img src="http://www.vogella.de/blog/wp-content/uploads/2010/03/osgi301.gif" alt="" width="595" height="449" class="aligncenter size-full wp-image-2206" /></a></p>
<p>Many thanks to <a href="http://twitter.com/njbartlett">Neil Bartlett</a> for sharing this tip via <a href="http://twitter.com/vogella">twitter</a>. </p>
<p class="wp-flattr-button"></p> <p><a href="http://www.vogella.de/blog/?flattrss_redirect&amp;id=2197&amp;md5=446df7c48ff277102e87fc4caeb6ca3c" 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/2010/03/12/converting-osgi-bundle-to-plugin/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Poll &#8211; Default launch configuration for Eclipse plugin  / RCP development</title>
		<link>http://www.vogella.de/blog/2009/11/20/launch-configuration-consolelog/</link>
		<comments>http://www.vogella.de/blog/2009/11/20/launch-configuration-consolelog/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 14:50:12 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Question]]></category>
		<category><![CDATA[RCP]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=1367</guid>
		<description><![CDATA[Eclipse shows errors during a launch via the log views in both the host and the target system and on the file system. In addition the developer can specify the flag "-consoleLog" in the launch configuration so see potential error messages in the console view. 

Bug 284704  had been opened asking if the ...]]></description>
			<content:encoded><![CDATA[<p>Eclipse shows errors during a launch via the log views in both the host and the target system and on the file system. In addition the developer can specify the flag &#8220;-consoleLog&#8221; in the launch configuration so see potential error messages in the console view. </p>
<p><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=284704">Bug 284704 </a> had been opened asking if the &#8220;-consoleLog&#8221; flag could be included by default in a new launch configuration. </p>
<p>What do you think? If you are a plugin or RCP developer please participate in the following survey:</p>
<p><strong> <a href="http://www.surveymonkey.com/s.aspx?sm=5xQC1WSw_2bHjlqhjUdTeHRA_3d_3d"> Link to Survey </a></strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Please note that this is my first attempt using SurveyMonkey, I hope this works well. I believe the survey <strong>will close after the first 100 answers</strong>. If this number has not reached I&#8217;m planning to close the survey next week <strong>27. Nov. 2009</strong>.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2009/11/20/launch-configuration-consolelog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>API for reading Eclipse plugin dependencies</title>
		<link>http://www.vogella.de/blog/2009/10/19/eclipse-plugin-dependencies/</link>
		<comments>http://www.vogella.de/blog/2009/10/19/eclipse-plugin-dependencies/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 05:04:02 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=1241</guid>
		<description><![CDATA[The Eclipse platform provides an API to allows that you can access in information of the MANIFEST.MF. For example you could read the dependencies of your plugin. 

For this example create a plugin "de.vogella.pde.dependencies". See Eclipse Plugin development for examples on how to develop plugins. Use the "Hello, World Command" template.

Define dependendies to the ...]]></description>
			<content:encoded><![CDATA[<p>The Eclipse platform provides an API to allows that you can access in information of the MANIFEST.MF. For example you could read the dependencies of your plugin. </p>
<p>For this example create a plugin &#8220;de.vogella.pde.dependencies&#8221;. See <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html">Eclipse Plugin development</a> for examples on how to develop plugins. Use the &#8220;Hello, World Command&#8221; template.</p>
<p>Define dependendies to the following plugins:<br />
 &#8211; org.eclipse.ui<br />
 &#8211;  org.eclipse.core.runtime</p>
<p>Change the command to the following. </p>
<pre class="brush: java; title: ; notranslate">

package de.vogella.pde.dependencies.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.ManifestElement;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;

public class PrintDependencies extends AbstractHandler {
	public Object execute(ExecutionEvent event) throws ExecutionException {
		String requireBundle = (String)Platform.getBundle(&quot;de.vogella.pde.dependencies&quot;).getHeaders().get(
				Constants.REQUIRE_BUNDLE);
				try {
					ManifestElement[] elements = ManifestElement.parseHeader(
					Constants.BUNDLE_CLASSPATH, requireBundle);
					for (ManifestElement manifestElement : elements) {
						System.out.println( manifestElement.getValue());
					}
				} catch (BundleException e) {
					e.printStackTrace();
				}
		return null;
	}
}
</pre>
<p>If you now run your new plugin it and select your command it will print out the dependencies of your plugin. </p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2009/10/19/eclipse-plugin-dependencies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Eclipse Papercut #6 &#8211; Modifying Mylyn Context</title>
		<link>http://www.vogella.de/blog/2009/10/05/modifying-mylyn-context/</link>
		<comments>http://www.vogella.de/blog/2009/10/05/modifying-mylyn-context/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 06:06:55 +0000</pubDate>
		<dc:creator>Lars Vogel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Papercut]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[JDT]]></category>
		<category><![CDATA[Mylyn]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.vogella.de/blog/?p=1183</guid>
		<description><![CDATA[Change the Mylyn context in a task]]></description>
			<content:encoded><![CDATA[<p>In this episode of <a href="http://www.vogella.de/blog/2009/06/29/paper-cuts/">Eclipse Papercuts </a> I will demonstrate how to modify the <a href="www.eclipse.org/mylyn/?phpMyAdmin=pGYgzr5q5pQd6aMfv3bd9m1zbi3">Mylyn</a> tasks context. Many thanks to <a href="http://greensopinion.blogspot.com/">David Green </a> for providing sample code to access the Mylyn context.</p>
<p><a href="http://www.vogella.de/articles/Mylyn/article.html">Mylyn</a> makes certain assumptions how the developer works. If you start a new task the Mylyn context is empty and fills up based on the selected files. </p>
<p>Which is not always the way I work. Frequently I know that for my task a whole package (or project) is relevant. I would like to include all classes in this package / project in my Mylyn task.</p>
<p>Ok, lets see how we can solve this papercut. I describe how to add Java classes from a package to an active task.</p>
<p>Create an command which extends the package explorer with a new popup commands as described here <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html#packageexplorer">Extend the package explorer</a>.</p>
<p>Create the command handler with the following coding:</p>
<pre class="brush: java; title: ; notranslate">

package de.vogella.mylyn.tasksmodify.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.monitor.core.InteractionEvent.Kind;
import org.eclipse.ui.handlers.HandlerUtil;

public class SampleHandler extends AbstractHandler {
	public Object execute(ExecutionEvent event) throws ExecutionException {

		IStructuredSelection selection = (IStructuredSelection) HandlerUtil
				.getActiveMenuSelection(event);
		if (selection ==null){
			return null;
		}

		Object firstElement = selection.getFirstElement();

		if (firstElement instanceof IPackageFragment) {
			IPackageFragment mypackage = (IPackageFragment) firstElement;
			try {
				if (mypackage.getKind() == IPackageFragmentRoot.K_SOURCE){
					 ICompilationUnit[] compilationUnits = mypackage.getCompilationUnits();
					 for (ICompilationUnit iCompilationUnit : compilationUnits) {
						 IInteractionContext activeContext = ContextCore.getContextManager()
							.getActiveContext();
						 ContextCorePlugin.getContextManager().processInteractionEvent(iCompilationUnit,
									Kind.PROPAGATION, InteractionEvent.ID_UNKNOWN, activeContext);
					}
				}
			} catch (JavaModelException e) {
				e.printStackTrace();
			}
		}

		return null;
	}
}
</pre>
<p>Launch your plugin. Create a Mylyn task and select a package in the package explorer. Select your commands and all files of this package will be added to the task.</p>
<p>Further reading: If you want to access other Java Elements, e.g. Project and add them to the Mylyn task this tutorial might help you: <a href="http://www.vogella.de/articles/EclipseJDT/article.html">Eclipse JDT</a>.</p>
<p>Please note that ContextCorePlugin is supposed to be internal API but I did not find another way of accessing the Mylyn tasks. </p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.vogella.de/blog/2009/10/05/modifying-mylyn-context/feed/</wfw:commentRss>
		<slash:comments>4</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>
	</channel>
</rss>

