Multiple Key Bindings to Single Action [message #481994] |
Mon, 24 August 2009 22:18  |
Eclipse User |
|
|
|
I'm attempting to get multiple key bindings be redirected to once class
which will call the appropriate method for each key binding. My key
binding class is
public class KeyAction extends LispAction{
public void run(IAction action) {
// TODO Auto-generated method stub
}
}
where lispaction extends Action and implements IEditorActionDelegate.
Then, the xml i try to use is below.
I'm trying to use a parameter for each keybinding and somehow i'll get it
in the run method above. If only i can figure out how that parameter thing
works, everything will be fine. I would like to ask if I'm approaching this
the correct way. Any help would be appreciated
Thanks!
<extension
point="org.eclipse.ui.bindings">
<key
commandId="jasko.tim.lisp.paredit.KeyAction"
contextId="jasko.tim.lisp.context1"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+0">
<parameter
id="org.eclipse.ui.views.showView.viewId"
value="test"/>
</key>
</extension>
<extension point="org.eclipse.ui.editorActions">
<editorContribution
targetID="jasko.tim.lisp.editors.LispEditor"
id="jasko.tim.lisp.paredit">
<action
class="jasko.tim.lisp.paredit.KeyAction"
definitionId="jasko.tim.lisp.paredit.KeyAction"
id="jasko.tim.lisp.paredit.KeyAction"
label="Paredit KeyAction">
</action>
</editorContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
categoryId="jasko.tim.lisp.category1"
id="jasko.tim.lisp.paredit.KeyAction"
name="Paredit KeyAction">
</command>
</extension>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05066 seconds