Problem Binding action to shortcut programatically [message #334305] |
Mon, 02 February 2009 11:37  |
Eclipse User |
|
|
|
Hi-ya
I have an action that I am having trouble programmatically binding to a
key binding.
As shown below, I am defining the command, and defining a key binding, and
then in the constructor of the action I am calling setActionDefinitionId
with the id of the command (BLAH). In a view I am setting the global
action handler with the action and updating the action bars.
The key binding seems be registered ok, when I press ctrl-shift-l I can
even see it. But if I click on it or press CTRL+SHIFT+3 nothing happens,
as if the action is not enabled. However I have also ensured that enabled
is always true.
This is perplexing, what could I be doing wrong? Or where could I set a
break point to see what happens when I press CTRL+SHIFT+3?
Thanks.
########## Code #########
<extension point="org.eclipse.ui.bindings">
<key sequence="CTRL+SHIFT+3"
commandId="BLAH"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
contextId="org.eclipse.ui.contexts.window" />
</extension>
<extension
point="org.eclipse.ui.commands">
<command
id="BLAH"
name="Hello">
</command>
</extension>
// Code in View
getViewSite().getActionBars().setGlobalActionHandler(newFall Action.getId(),
newFallAction);
getViewSite().getActionBars().updateActionBars();
|
|
|
|
Powered by
FUDForum. Page generated in 0.02652 seconds