How to undo an IntentionAction

Hi,

is it possible to undo an IntentionAction? If so, what do I need to do to achieve this? Implementing both IntentionAction and UndoableAction within one class did not succeed.

Kind regards

Ansgar

1 comment
Comment actions Permalink

Hello Ansgar,

is it possible to undo an IntentionAction? If so, what do I need to do
to achieve this? Implementing both IntentionAction and UndoableAction
within one class did not succeed.


If your intention action modifies the source code, the changes will be undoable
using the standard undo infrastructure - no need to do anything else. If
your intention does something else like modifying some settings, you need
to call UndoManager.getInstance().undoableActionPerformed() during the course
of your intention execution.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.