help needed with key bindings: can anyone send me a simple example? [message #260826] |
Mon, 12 July 2004 13:41  |
Eclipse User |
|
|
|
Dear All,
I am having trouble getting key-bindings to work in my plugin (I've gone
through the documentation, but I can't get it to work for me).
Can anyone send me a simple example that shows how to create a
key-binding for an action? (i.e. a mini-plugin or some code snippets)
Thanks in advance,
- Daniel
|
|
|
Re: help needed with key bindings: can anyone send me a simple example? [message #260831 is a reply to message #260826] |
Mon, 12 July 2004 13:56  |
Eclipse User |
|
|
|
Originally posted by: douglas.pollock.magma.ca
Daniel Winterstein wrote:
> I am having trouble getting key-bindings to work in my plugin (I've gone
> through the documentation, but I can't get it to work for me).
> Can anyone send me a simple example that shows how to create a
> key-binding for an action? (i.e. a mini-plugin or some code snippets)
Look at "plugin.xml" for "org.eclipse.ui". Look in the commands extension
point. But, roughly, you want something like
<command
name="Redo"
description="Does the last command again"
categoryId="org.eclipse.ui.category.edit"
id="org.eclipse.ui.edit.redo">
</command>
<keyBinding
commandId="org.eclipse.ui.edit.redo"
keySequence="M1+Y"
keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration ">
</keyBinding>
And then a snippet of code that creates your action and sets its action
definition id. This could either be some XML (e.g., the pop-up menus
extension point), or some Java code.
cheers,
d.
|
|
|
Powered by
FUDForum. Page generated in 0.06520 seconds