Can I cancel/undo a refactoring in a listener?

The openapi really is cool. I wrote a little plugin that updates properties files whenever some elements are moved/renamed. Big time saver.

Yet, when anything wents wrong doing this, I'd like to cancel/undo the refactoring. Currently I pop up a dialog (using Messages.showErrorDialog()), show a message describing the problem and tell the user to "please undo".

Is there a better solution, so that the refactoring is undone automatically? (I'd have to show the dialog anyway, off course, but that would ensure a consistent state.)

1 comment
Comment actions Permalink

Stephen Kelvin wrote:

The openapi really is cool. I wrote a little plugin that updates
properties files whenever some elements are moved/renamed. Big time saver.

Yet, when anything wents wrong doing this, I'd like to cancel/undo the
refactoring. Currently I pop up a dialog (using
Messages.showErrorDialog()), show a message describing the problem and
tell the user to "please undo".

Is there a better solution, so that the refactoring is undone
automatically? (I'd have to show the dialog anyway, off course, but that
would ensure a consistent state.)


Not at the moment. Sorry.

Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.