Undo/Redo keyboard shortcuts in a JFace dialog [message #1385882] |
Wed, 11 June 2014 22:52 |
Marian Schedenig Messages: 18 Registered: July 2012 |
Junior Member |
|
|
I have a plug-in that uses the workbench's operation history for operations affecting its model, so undo/redo works nicely in the plugin's own view.
But in certain situations, the plugin opens a modal dialog (via a command handler triggered by a keyboard shortcut), and that dialog should provide undo and redo as well. I can *call* the operations just fine via the operation history, but I have trouble binding them to the correct keyboard shortcuts, since I haven't found a way to hook into the global undo/redo actions from a dialog, or grab the configured shortcuts from the config.
I could of course just hardcode the keys. That works reasonably well for M1+Z as the undo shortcut, but redo already gets more complicated as it differs between platforms. Plus if the user reconfigured his shortcuts, my hardcoded key combinations would of course be blissfully ignorant of it.
Is there a standard way to deal with this? Or if not, is there any way I can, from inside a plugin's Activator, grab the configured keyboard shortcuts for these operations?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03053 seconds