How to enable undo/redo operations on the Tree Editor #156
-
I'm currently doing good progress on using the Tree Editor with my Model Server. So far I've followed the Coffee Editor as template for my implementation. I'm able to show my model, create and delete different kind of nodes and save my changes on the Model Server. The save operation was easy to implement since my widget implements I would expect to have a similar mechanism in my widget to implement the logic for undo/redo, However I could not find any reference to undo or redo on the Is the undo/redo operations available for the Tree Editor? if so, how to use them? Many thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @agonzalezgaliana! Basically, undo/redo is available via the common Theia undo/redo commands from the menu
Hope that helps and best wishes, PS: Please feel free to open an issue and/or in case you would like to see it in the theia-tree-editor base framework, thanks! |
Beta Was this translation helpful? Give feedback.
Hi @agonzalezgaliana!
Great to hear that you use the tree editor! 🌳
Basically, undo/redo is available via the common Theia undo/redo commands from the menu
Edit > Undo / Redo
, but the tree-editor widget does not handle those commands yet.For example, the (GLSP) Diagram widget overrides the global Theia undo/redo commands and dispatches a dedicated
Undo/RedoAction
which is handled by the server.This could also be picked up in the same manner for the tree-editor, and instead of dispatching an Action, directly call the
modelServerClient
withundo
/redo
.See for example in
sprotty-theia
: