Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Key Binding conflicts
Key Binding conflicts [message #442393] Mon, 16 January 2006 12:05 Go to next message
Eclipse UserFriend
Originally posted by: yassine.bensaid_.caramail.com

I am trying to add key bindings to my application using the code (in the
plugin.xml file):

<extension point="org.eclipse.ui.contexts">
<context
name="App.context"
description="App context"
id="App.context">
<!-- parentId="org.eclipse.ui.windows"-->
</context>
</extension>

<extension point="org.eclipse.ui.commands">
<category
name="App.category"
id="App.category">
</category>
<command
name="Delete item"
description="Deletes item from the list"
categoryId="App.category"
id="App.delete">
</command>
</extension>

<extension point="org.eclipse.ui.bindings">
<scheme
name="%keyConfiguration.app.name"
description="%keyConfiguration.app.description"
id="ae.sphere.arena.appAcceleratorConfiguration">
</scheme>
<key
commandId="Mapping.delete"
contextId="Mapping.context"
sequence="Ctrl+DEL"
schemeId="org.eclipse.ui.appAcceleratorConfiguration" />
</extension>

I also insert the "definitionId" field within the corresponding action, as
well as registering the context in the editor. The result is that I get no
key binding or whatsoever.
If I use the defaultAcceleratorConfiguration (in schemeId), it works fine
as long as I do not use "standard" key sequences (such as "DEL" for
deleting or "Ctrl+P" for printing). However using "standard" key sequences
gives again nothing; I think it is due to a conflict and that "DEL" must
be already used in the defaultAcceleratorConfiguration cancelling (in the
eclipse fashion) both actions. That's where my <scheme>...</scheme> code
(in the bindings extension) usage came from.... but it's not working.
Can you please suggest anything so I can use "standard" key sequences in
my application?
Re: Key Binding conflicts [message #442414 is a reply to message #442393] Mon, 16 January 2006 16:49 Go to previous messageGo to next message
Douglas Pollock is currently offline Douglas PollockFriend
Messages: 84
Registered: July 2009
Member
Yassine Bensaid wrote:
> If I use the defaultAcceleratorConfiguration (in schemeId), it works fine
> as long as I do not use "standard" key sequences (such as "DEL" for
> deleting or "Ctrl+P" for printing). However using "standard" key sequences
> gives again nothing; I think it is due to a conflict and that "DEL" must
> be already used in the defaultAcceleratorConfiguration cancelling (in the
> eclipse fashion) both actions. That's where my <scheme>...</scheme> code
> (in the bindings extension) usage came from.... but it's not working.
> Can you please suggest anything so I can use "standard" key sequences in
> my application?

Read "http://www.magma.ca/~pollockd/despumate/bindingsHowTo.html" and check
back here if you still have problems.



cheers,
d.
Re: Key Binding conflicts [message #442415 is a reply to message #442393] Mon, 16 January 2006 17:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tomasz.luchowski.com

Read this article:
http://www.magma.ca/~pollockd/despumate/bindingsHowTo.html

Among other things, it explains how to disable "standard" key configuration
so that you can plug-in your own and don't have conflicts if you try to
define something that already exists.

Cheers,
Tomasz

"Yassine Bensaid" <yassine.bensaid_@caramail.com> wrote in message
news:08e0ba0c495bb441f1fbc910cf54429a$1@www.eclipse.org...
>I am trying to add key bindings to my application using the code (in the
>plugin.xml file):
>
> <extension point="org.eclipse.ui.contexts">
> <context
> name="App.context"
> description="App context"
> id="App.context">
> <!-- parentId="org.eclipse.ui.windows"-->
> </context>
> </extension>
> <extension point="org.eclipse.ui.commands"> <category
> name="App.category"
> id="App.category">
> </category> <command
> name="Delete item"
> description="Deletes item from the list"
> categoryId="App.category"
> id="App.delete">
> </command>
> </extension>
> <extension point="org.eclipse.ui.bindings">
> <scheme
> name="%keyConfiguration.app.name"
> description="%keyConfiguration.app.description"
> id="ae.sphere.arena.appAcceleratorConfiguration">
> </scheme>
> <key
> commandId="Mapping.delete"
> contextId="Mapping.context"
> sequence="Ctrl+DEL"
> schemeId="org.eclipse.ui.appAcceleratorConfiguration" />
> </extension>
>
> I also insert the "definitionId" field within the corresponding action, as
> well as registering the context in the editor. The result is that I get no
> key binding or whatsoever.
> If I use the defaultAcceleratorConfiguration (in schemeId), it works fine
> as long as I do not use "standard" key sequences (such as "DEL" for
> deleting or "Ctrl+P" for printing). However using "standard" key sequences
> gives again nothing; I think it is due to a conflict and that "DEL" must
> be already used in the defaultAcceleratorConfiguration cancelling (in the
> eclipse fashion) both actions. That's where my <scheme>...</scheme> code
> (in the bindings extension) usage came from.... but it's not working.
> Can you please suggest anything so I can use "standard" key sequences in
> my application?
>
Re: Key Binding conflicts (need help desperately!!!) [message #443786 is a reply to message #442414] Sat, 04 February 2006 13:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yassine.bensaid_.caramail.com

Hi,

since I posted this mail, I've been reading books, related problems on
the news group and the link provided over and over
(http://www.magma.ca/~pollockd/despumate/bindingsHowTo.html). I think I
am by now an expert in what is not going to work for key bindings.
(sorry for this introduction...). Please help.
I will expose my problem again: I am using plugin.xml for all
configurations, and I am trying to bind the delete key "DEL" to delete
an item from a list. The action is already there; to say it all: if I
use bindings that are not already used (say "Ctrl+DEL"), it works fine
(I'm using org.eclipse.ui.bindings; org.eclipse.ui.commands;
org.eclipse.ui.contexts; put the definitionId in the action and add the
code site.getKeyBindingService().setScopes(new
String[]{"myPlugin.context"}) in the editor).
Now, I have learned from my readings, that
org.eclipse.ui.defaultAcceleratorConfiguration defines the command
org.eclipse.ui.edit.delete and therefore already reserves the sequence
"DEL". So: I either have to use another sequence if I want to use the
default accelerator (which I did, and is working but it is sadly not of
interest to me) OR use our own accelerator (using <scheme>...</scheme>)
which I also did BUT it is not working for some reason. YES, I did add
the line org.eclipse.ui/KEY_CONFIGURATION_ID=my.Accelerator.ID to
plugin_customization.ini (to avoid confusion I put it in both
development plugin and built plugin), but still not working. I used
debugging (with ".options" file) and it is showing me that (using my own
accelerator):
- with DEL: it is recognized as org.eclipse.ui.edit.delete and it is
not handled
- with M2+DEL: it "sees" the key sequence (ALT+DEL) but nothing else
(WorkbenchKeyboard.press(potentialKeyStrokes = [ALT+DEL])).

I tried adding a line the ".options" file to see if the accelerator
is activated, but apparently, the added line does not mean anything to it.

Please help.

Thank you in advance,

faithfully yours,

Yassine Bensaid

PS: I also tried to trick eclipse by putting another key sequence to
org.eclipse.ui.edit.delete and then use DEL for myself, but it doesn't
like the idea.

Douglas Pollock wrote:
>
> Read "http://www.magma.ca/~pollockd/despumate/bindingsHowTo.html" and check
> back here if you still have problems.
>
>
>
> cheers,
> d.
>
Re: Key Binding conflicts (need help desperately!!!) [message #443852 is a reply to message #443786] Sun, 05 February 2006 05:31 Go to previous message
Eclipse UserFriend
Originally posted by: yassine.bensaid_.caramail.com

Hi,

I created a very new plugin on a new application (based on the email
rcp example provided in eclipse) and tested with the method of
plugin_customization.ini file, and it's working! (I don't know how I
didn't think about that earlier). Now I guess, the problem I have is
related to conflicts within plugins of the same application (since I am
using key bindings in different plugins).

Any suggestions and advices would be appreciated

Regards,

Yassine Bensaid

Yassine Bensaid wrote:
> Hi,
>
> since I posted this mail, I've been reading books, related problems on
> the news group and the link provided over and over
> (http://www.magma.ca/~pollockd/despumate/bindingsHowTo.html).
>>
Previous Topic:RCP Training
Next Topic:How to report error with product's export?
Goto Forum:
  


Current Time: Sun Dec 08 06:34:18 GMT 2024

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

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

Back to the top