Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » keybindings again: works for one user but not another
keybindings again: works for one user but not another [message #333317] Thu, 04 December 2008 01:49 Go to next message
Eclipse UserFriend
Originally posted by: maggie.eclipse.gmail.com

Hi,

Searched through the archive, but didn't find a similar post to my problem.

I'm trying to add a key binding for an existing command
(com.foo.bar.command1) which can be invoked from the context menu of an
editor or a selected resource in the Project Explorer.

After added the following lines in my plugin.xml, the "Ctrl+C Ctrl+H"
appears on the context menu next to the label of the command.
<key
commandId="com.foo.bar.command1"
contextId="org.eclipse.ui.contexts.window"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M1+C M1+H">
</key>

But it works only if I click the key binding in an editor. If I try to
use the key bindings when select a resource in the Project Explorer,
there is no effect. Selecting the menu item using mouse does invoke the
command.

A coworker tried this in her workspace, and it worked in both editor and
Project Explorer!!

Would any environment setting impact the key binding behavior? Any idea
what to check?

This happens with Eclipse 3.3 on Linux.

Thanks
Maggie
Re: keybindings again: works for one user but not another [message #333335 is a reply to message #333317] Thu, 04 December 2008 12:39 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It's always possible it might be a setting in your Window Manager
(assistive technologies activated, key bound to window function, etc).

On thing you can do is to start up your eclipse with tracing turned on:
http://wiki.eclipse.org/Platform_Command_Framework#Tracing_O ption

Use com.foo.bar.command1 as the
org.eclipse.ui/trace/handlers.verbose.commandId

That will tell you 1) if eclipse received the key events and 2) if it is
trying to invoke the handler.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Project Explorer vs. Navigator [Re: keybindings again: works for one user but not another] [message #333359 is a reply to message #333335] Fri, 05 December 2008 01:15 Go to previous message
Eclipse UserFriend
Originally posted by: maggie.eclipse.gmail.com

Hi Paul,

Thanks for the useful tips. The answers to your questions are "yes".

After further debugging, we realized that neither mouse click nor short
cut work if the file is selected in CDT's Project Explorer. They both
work fine in the Navigator view or the JDT's Package Explorer.

This observation helped us to track down a bug in how we cast the
selected element. In stead of static casting the selected element from
Object to IFile, we should have done a dynamic casting using an Adapter.

Now both short cut and mouse click work in CDT's Project Explorer perfectly.

Thanks
Maggie

Paul Webster wrote:
> It's always possible it might be a setting in your Window Manager
> (assistive technologies activated, key bound to window function, etc).
>
> On thing you can do is to start up your eclipse with tracing turned on:
> http://wiki.eclipse.org/Platform_Command_Framework#Tracing_O ption
>
> Use com.foo.bar.command1 as the
> org.eclipse.ui/trace/handlers.verbose.commandId
>
> That will tell you 1) if eclipse received the key events and 2) if it is
> trying to invoke the handler.
>
> PW
>
>
Previous Topic:Change to shift click function
Next Topic:LaunchConfigurationDelegate related question
Goto Forum:
  


Current Time: Thu Apr 25 04:31:51 GMT 2024

Powered by FUDForum. Page generated in 0.04477 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top