KeyBindings, ActionSets and more [message #460885] |
Mon, 01 January 2007 11:11  |
Eclipse User |
|
|
|
Originally posted by: florianwendland.freenet.de
Hello all,
i have an app with several views, in what I have defined several actions
directly to the view. Now i want to add special key bindings to every
action, something like CTRL+ALT+O for a delete action.
I have read in the eclipsepedia, that the extension point commands use
the keyBinding to define global keybindings. Than, an actionset with the
action has tob configured and binded to the command, so that the global
keybinding is bind to the command and thus, to the action i defined.
Is this the correct order of defining keyBindings?
1. Define an actionSet
2. Define an action
3. Define a command, bind the action to the command
4. Define a keyBinding
5. Register the Action to the vieSite bey calling
action.setActionDefinitionId("some.unique.id");
view.getSite().getKeyBindingService().registerAction(action) ;
I would be gratefull, if someone could give me an answer, because i
havent worked with action sets before.
Thx
Florian
|
|
|
Re: KeyBindings, ActionSets and more [message #461176 is a reply to message #460885] |
Fri, 05 January 2007 19:10  |
Eclipse User |
|
|
|
I guess it depends on what kind of actions you create.
For example, org.eclipse.ui.actionSets are for global window actions,
and show up in the main menu and main toolbar.
org.eclipse.ui.viewActions and programmatic actions added to your
getViewSite().getActionBars().getMenuManager() are specific to your
view. They show up in the view menu and view toolbar.
If you are using the action bars to add actions directly, you don't need
actionSets ... you just have to define a command in
org.eclipse.ui.commands, define a keybinding in org.eclipse.ui.bindings,
and then do your step 5.
If you have 3.2.x, there are even more options open to you. See
http://wiki.eclipse.org/index.php/Platform_Command_Framework #Using_an_IActionDelegate_to_execute_a_command
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.04304 seconds