Binding commands to IActionDelegate in context menus [message #467788] |
Thu, 10 May 2007 14:13  |
Eclipse User |
|
|
|
Hi!
Although this issue has been discussed here many times before, I'm still
stuck with the command vs. action vs. handler issue.
All I want to do is to register actions (via "org.eclipse.ui.popup"
extension point) for my editor's context menu and bind them to commands
as well as binding keyboard shortcuts to them. The workload itself
should be done inside the run-method of my action implementations
(IEditorActionDelegate).
Before I go into details, in short: The keyboard shortcuts do not work
for actions in the context menu, but they do work for toolbar actions.
What I've got so far:
1) each command is registered using the extension point
"org.eclipse.ui.commands".
2) each command has at least one keybinding as defined via extension
point "org.eclipse.ui.bindings".
3) the keybindings are bound to a special context that is activated and
deactivated along with activation and deactivation of my editor.
4) there are IActionDelegates registered for my editor's popup menu
using the extension point "org.eclipse.ui.popup". The definitionId is
set to the id of the corresponding command.
5) a subset of the IActionDelgates are also registered for my editor's
toolbar via extension point "org.eclipse.ui.editorActions".
Result:
When the editor is opened, all actions show up in the context menu along
with their keyboard shortcuts (as defined in step 2 above). A subset of
the actions is visible in the editor's toolbar.
All actions do their job fine when activated via mouseclick.
BUT: While the subset of the toolbar actions are accessible via keyboard
shortcuts, the shortcuts do not work for my popup-only actions!
So what I'm doing wrong? I'd appreciate every help on that issue!
Thanks in advance,
Mario
|
|
|
Re: Binding commands to IActionDelegate in context menus [message #467800 is a reply to message #467788] |
Thu, 10 May 2007 14:57  |
Eclipse User |
|
|
|
Mario Winterer wrote:
> BUT: While the subset of the toolbar actions are accessible via keyboard
> shortcuts, the shortcuts do not work for my popup-only actions!
>
>
> So what I'm doing wrong? I'd appreciate every help on that issue!
>
Are you working in 3.2.x or 3.3? In 3.2.x the context menu->keybinding
is broken. In 3.3, it works ... except that context menu
IActionDelegates are only active "handlers" while the context menu is open.
In both cases you can also register a handler against the same command
that does similar (the same) work as the IActionDelegate ... but you
have to be careful of what selection you need to work against.
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.03630 seconds