Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How I got command key-bindings to work for actions
How I got command key-bindings to work for actions [message #276235] Fri, 19 November 2004 13:41
Eclipse UserFriend
For those posters who, like me, found that calling setActionDefinitionId()
on an Action to associate it with a Command doesn't make the Command's
key-bindings invoke the Action, here's what I did to make it work:

1.
In my EditorActionBarContributor extension, I added a block like the
following, to submit a handler for the action to the workbench:

HandlerSubmission submission = new HandlerSubmission(null, null, null,
command.getId(), new ActionHandler(action), Priority.MEDIUM);
PlatformUI.getWorkbench().getCommandSupport().addHandlerSubm ission(submission);
handlerSubmissions.add(submission);

2.
In the dispose() method of that same class, I added the following:

PlatformUI.getWorkbench().getCommandSupport().removeHandlerS ubmissions(handlerSubmissions);

If you don't do this, the submissions of future instances of your
EditorActionBarContributor extension will conflict with this one.


Hope this helps anyone who, like me, gets stuck on this problem.

--Jeff
Previous Topic:Use Eclipse deploy operation from command line?
Next Topic:OSGI plugin manifest - getting rid of from existing plugin
Goto Forum:
  


Current Time: Wed Jul 23 18:48:42 EDT 2025

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

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

Back to the top