Custom Undo and Redo Behaviour for CreateConnectionFeature [message #1753050] |
Wed, 01 February 2017 08:02  |
Eclipse User |
|
|
|
Hi everyone
For my diagram editor I have some features which implement ICustomUndoRedoFeature for custom undo and redo behaviour. When the feature is executed I need to remember some used objects which are required in the case of an undo. Currently I do this by putting some properties into the context of the execute(IContext context) method and retrieve them from the context of preUndo(IContext context) method. My assumption was that the context passed to the execute is the same instance as the one passed to preUndo. For most cases it works like that and everything is fine.
For my CreateConnectionFeature however, the context passed to execute(IContext context) is a different instance then the context passed to preUndo(IContext context). This means that the properties I put in during execution are not available in undo.
What is the expected behaviour? Is my assumption that the context instance should always be the same for one execution wrong? If so, what would be the proper way of remembering some objects for a feature execution, which are later available for undo and redo? If not then this is either a bug or something else is going wrong in my implementation. Any ideas?
Thanks,
Thomas
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06213 seconds