Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Keybinding
Keybinding [message #464428] Sun, 04 March 2007 22:10 Go to next message
Eclipse UserFriend
Hi everyone,

I want to know how do I define a key binding for action, and make it
dynamically configuration during the runtime. So what i have done so far
in my app, i have defined a command and associates a key binding to this
command. During the initialization, i have used IKeyBindingService to
register an action that has setActionDefId to the command id. so far, it
is working. and my question is am i doing it correctly, and how do i make
the key sequence configurable like the Preference->General->Keys in
Eclipse.
Re: Keybinding [message #465225 is a reply to message #464428] Mon, 26 March 2007 10:55 Go to previous message
Eclipse UserFriend
If you've used org.eclipse.ui.commands and org.eclipse.ui.bindings to
define the initial keybinding, then you can use:
IHandlerService s
= (IHandlerService) getSite().getService(IHandlerService.class);
s.activeHandler("commandId", handler);

handler can either be the AbstractHandler implementation of your action
or an ActionHandler (which wraps an IAction).

If you want to allow users to go back and configure it, you can include
the keys preference page (old or new).

Later,
PW
Previous Topic:Opening exising preference page via context menu
Next Topic:"Help" action, changing browser type from mozilla to firefox
Goto Forum:
  


Current Time: Mon Jul 07 22:24:42 EDT 2025

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

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

Back to the top