Global undo/redo in an RCP app [message #444259] |
Mon, 13 February 2006 05:06 |
rick cameron Messages: 9 Registered: July 2009 |
Junior Member |
|
|
I've just been looking at the new (as of 3.1) undo/redo support. It seems
very flexible and powerful.
In my RCP app, I just want to have a single command stack; I don't need the
flexibility of separate sets of commands for each view or editor. To achieve
this, it looks to me like I should add the retargetable undo & redo actions
to the Edit menu, then in every view & editor, register action handlers for
undo & redo, using the same IUndoContext.
I think this will work - but it would be simpler if I could just put undo &
redo actions on the Edit menu that always referred directly to the default
IOperationHistory. I don't think the existing UndoActionHandler and
RedoActionHandler can be used for this, as they require an
IWorkbenchPartSite in the constructor.
Is there a way to achieve this using existing classes? If not, I guess I'd
have to merge code from ActionFactory.UNDO and UndoActionHandler to produce
an appropriate action.
As a JFace/RCP neophyte I can't judge whether it would be appropriate to add
classes like this to the libraries - but, if so, please consider doing so. I
bet there are a lot of apps like mine with a simple model of undo/redo that
would benefit from it!
Thanks
- rick
|
|
|
Powered by
FUDForum. Page generated in 0.03161 seconds