SWT actions using shortcuts ... without having to add them to the menu

Currently, we have implemented many SWT actions because it is a good way to link one command to add to menus and toolbars and have keyboard shortcuts for these commands.

Now ... how can I register an action in a simple SWT / JFace without adding it to the menu bar, but so that it can still be called up using a keyboard shortcut?

+3
source share
2 answers

I use for this in a simple SWT, using Display.addFilterin an event KeyDown. See this question for an example.

0
source

Use the org.eclipse.ui.bindings extension and add a new key.

(M1, M2, M3 M4 , Shift, Command Alt, ). , Alt + D , "M3 + D" .

, . . . "plugin_customization.ini":

org.eclipse.ui/KEY_CONFIGURATION_ID=your.binding.scheme.id

"org.eclipse.ui.defaultAcceleratorConfiguration" , Eclipse, , , .

contextId , , org.eclipse.ui.contexts.window.

, , !

0

All Articles