<?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>EclipseSource Blog &#187; bindings</title>
	<atom:link href="http://eclipsesource.com/blogs/tag/bindings/feed/" rel="self" type="application/rss+xml" />
	<link>http://eclipsesource.com/blogs</link>
	<description>Eclipse Equinox OSGi</description>
	<lastBuildDate>Fri, 18 May 2012 15:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Tracing Keybindings in Eclipse RCP</title>
		<link>http://eclipsesource.com/blogs/2009/07/08/tip-tracing-keybindings-in-rcp/</link>
		<comments>http://eclipsesource.com/blogs/2009/07/08/tip-tracing-keybindings-in-rcp/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 07:42:57 +0000</pubDate>
		<dc:creator>Elias Volanakis</dc:creator>
				<category><![CDATA[syndicate]]></category>
		<category><![CDATA[bindings]]></category>
		<category><![CDATA[eclipse ui]]></category>
		<category><![CDATA[jface]]></category>
		<category><![CDATA[rcp]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://eclipsesource.com/blogs/?p=2212</guid>
		<description><![CDATA[When adding keybindings to an existing Eclipse RCP application, it is extremelly helpful to get realtime information about which keybinding registered and to what command handlers it is mapped to. Why is that?  Because sometimes the operating system or another widget will consume the keyboard event before it gets to the command framework. Other times there [...]]]></description>
			<content:encoded><![CDATA[<p>When adding keybindings to an existing Eclipse RCP application, it is extremelly helpful to get realtime information about which <a href="http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/guide/workbench_cmd_bindings.htm">keybinding</a> registered and to what <a href="http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/guide/workbench_cmd_handlers.htm">command handlers</a> it is mapped to. Why is that?  Because sometimes the operating system or another widget will consume the keyboard event before it gets to the command framework. Other times there are several handlers bound to the same key causing a conflict.</p>
<h4>Enabling Tracing for Keybindigs</h4>
<p>Fortunatelly, this information is easy to get, if you enable the right tracing options:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">org.eclipse.ui/debug = true
org.eclipse.ui/trace/keyBindings = true
org.eclipse.ui/trace/keyBindings.verbose = true</pre></div></div>

<p style="text-align: center; "><a href="http://eclipsesource.com/blogs/wp-content/uploads/2009/07/trace_keybindings.png"><img class="aligncenter size-full wp-image-2213" style="border: 1px solid black;" title="trace_keybindings" src="http://eclipsesource.com/blogs/wp-content/uploads/2009/07/trace_keybindings.png" alt="trace keybindings Tracing Keybindings in Eclipse RCP" width="658" height="397" /></a></p>
<p>After that each keystroke will produce some output on the console:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">KEYS --- WorkbenchKeyboard.press(potentialKeyStrokes = [CTRL+PAGE_UP, CTRL+])
KEYS --- WorkbenchKeyboard.executeCommand(commandId = 'org.eclipse.riena.navigation.ui.previousSubApplication', parameters = {})</pre></div></div>

<p>In the above you can see that Ctrl+PageUp is mapped to the &#8216;previousSubApplication&#8217; command.</p>
<p>Some times there is a conflict &#8211; i.e. one keybinding is mapped to two or more &#8216;active&#8217; command handlers. This looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">BINDINGS --- A conflict occurred for CTRL+SHIFT+W
BINDINGS ---     [Binding(CTRL+SHIFT+W,
	ParameterizedCommand(Command(org.eclipse.ui.file.closeAll,Close All,
		Close all editors,
		Category(org.eclipse.ui.category.file,File,null,true),
		org.eclipse.ui.internal.CloseAllHandler,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system), Binding(CTRL+SHIFT+W,
	ParameterizedCommand(Command(org.eclipse.riena.navigation.ui.closeModuleGroup,Close module group,
		,
		Category(org.eclipse.riena.navigation.ui.swt,Riena Navigation Commands,null,true),
		org.eclipse.riena.internal.navigation.ui.swt.handlers.CloseModuleGroup@39880a,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)]</pre></div></div>

<p>What happened here is that Ctrl+Shift+W was already bound to the CloseAllHandler via the &#8216;file.closeAll&#8217; command. I was not aware of this initially, because it is defined in the org.eclipse.ui plugin. So I accidentally bound another command and handler to Ctrl+Shift+W. With the output I quickly realized what was going on. I ditched my own command and instead made &#8216;CloseModuleGroup&#8217; a handler for the &#8216;file.closeAll&#8217; command.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclipsesource.com/blogs/2009/07/08/tip-tracing-keybindings-in-rcp/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tip: Suppressing Keybindings</title>
		<link>http://eclipsesource.com/blogs/2008/07/18/tip-suppressing-keybindings/</link>
		<comments>http://eclipsesource.com/blogs/2008/07/18/tip-suppressing-keybindings/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 11:46:35 +0000</pubDate>
		<dc:creator>Chris Aniszczyk</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[bindings]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[rcp]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://code9.com/?p=31</guid>
		<description><![CDATA[I was helping a colleague today with a key binding issue that I think is fairly common. To illustrate the problem, let&#8217;s look at what happens when you press CMD+N in the RCP mail sample: What!? New Project Wizard? That&#8217;s not what I wanted! In this case, I actually wanted a &#8216;New Message&#8217; to pop [...]]]></description>
			<content:encoded><![CDATA[<p>I was helping a colleague today with a key binding issue that I think is fairly common. To illustrate the problem, let&#8217;s look at what happens when you press CMD+N in the RCP mail sample:</p>
<p><a href="http://eclipsesource.com/blogs/wp-content/uploads/2008/07/picture-1.png"><img class="alignnone size-full wp-image-32" title="figure1" src="http://eclipsesource.com/blogs/wp-content/uploads/2008/07/picture-1.png" alt="picture 1 Tip: Suppressing Keybindings" width="500" height="313" /></a></p>
<p>What!? New Project Wizard? That&#8217;s not what I wanted! In this case, I actually wanted a &#8216;New Message&#8217; to pop up instead of that new wizard. I don&#8217;t want any of my end-users ever seeing this dialog! What&#8217;s the problem here? Well, in simple terms, Eclipse is using its own default key configuration scheme if you don&#8217;t set one. So by default, you may get strange results like above or even conflicts with existing key bindings.</p>
<p>What&#8217;s the solution?</p>
<p>Well, there are a few ways to go about this but I think the simplest one for most people is to simply create your own key configuration scheme and instruct Eclipse to use it. To do this, you first need to create your own scheme:</p>
<pre class="brush: xml">
&lt;extension point=&quot;org.eclipse.ui.bindings&quot;&gt;
&lt;scheme
id=&quot;mail.scheme&quot;
name=&quot;My Mail Scheme&quot;&gt;
&lt;/scheme&gt;
&lt;/extension&gt;
</pre>
<p>After that, make sure your bindings are instructed to use this scheme:</p>
<pre class="brush: xml">
&lt;extension
point=&quot;org.eclipse.ui.bindings&quot;&gt;
&lt;key
commandId=&quot;mail.open&quot;
schemeId=&quot;mail.scheme&quot;
sequence=&quot;M1+N&quot;&gt;
&lt;/key&gt;
&lt;key
commandId=&quot;mail.openMessage&quot;
schemeId=&quot;mail.scheme&quot;
sequence=&quot;M1+3&quot;&gt;
&lt;/key&gt;
&lt;key
commandId=&quot;org.eclipse.ui.file.exit&quot;
schemeId=&quot;mail.scheme&quot;
sequence=&quot;M1+X&quot;&gt;
&lt;/key&gt;
&lt;/extension&gt;
</pre>
<p>Finally, you need to create a plugin_customization.ini if you don&#8217;t have one already for your application and put this in there:</p>
<p>org.eclipse.ui/KEY_CONFIGURATION_ID=mail.scheme</p>
<p>That&#8217;s it. Once you do that, you should have key binding bliss:</p>
<p><a href="http://eclipsesource.com/blogs/wp-content/uploads/2008/07/picture-2.png"><img class="alignnone size-full wp-image-33" title="figure2" src="http://eclipsesource.com/blogs/wp-content/uploads/2008/07/picture-2.png" alt="picture 2 Tip: Suppressing Keybindings" width="500" height="332" /></a></p>
<p>Thanks for listening and let me know if this helps. Here is the sample <a href="http://eclipsesource.com/blogs/wp-content/uploads/2008/07/mail.zip">project</a> for reference.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclipsesource.com/blogs/2008/07/18/tip-suppressing-keybindings/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

