Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Keybinding
Keybinding [message #464428] Mon, 05 March 2007 03:10 Go to next message
Lei is currently offline LeiFriend
Messages: 23
Registered: July 2009
Junior Member
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 14:55 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Fri Sep 20 20:22:57 GMT 2024

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

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

Back to the top