Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Undo/Redo keyboard shortcuts in a JFace dialog
Undo/Redo keyboard shortcuts in a JFace dialog [message #1385882] Wed, 11 June 2014 22:52 Go to next message
Marian Schedenig is currently offline Marian SchedenigFriend
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?
Re: Undo/Redo keyboard shortcuts in a JFace dialog [message #1396638 is a reply to message #1385882] Tue, 08 July 2014 15:33 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 772
Registered: January 2012
Senior Member

Hi Marian.

The undo/redo handlers are configured on a per-part basis. You'll need to provide your own custom handlers for the org.eclipse.ui.edit.undo and .redo that are applicable for your dialog.

Brian.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:Help icon in JFace Wizard
Next Topic:How to remember jFace treeviewer's expand state?
Goto Forum:
  


Current Time: Fri Sep 21 19:43:06 GMT 2018

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

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

Back to the top