Property View - changes cause undo problems [message #1032040] |
Tue, 02 April 2013 09:55  |
Eclipse User |
|
|
|
I have a number of nodes on the canvas, each with a textual name. I have implemented a property section as per tutorial that extends GFPropertySection and implements ITabbedPropertyConstants.
Node names have direct editing enabled.
Connections can be added between nodes via a creation feature that extends AbstractCreateConnectionFeature and implements ICreateConnectionFeature, ICustomUndoableFeature.
I have implemented custom undo and redo functions for non EMF model related changes.
If I add a connection between two nodes and then edit the node label using direct editing and then "undo" the changes (via CTRL-Z), the correct undo sequence is observed: label edit undo followed by connection undo with custom undo action.
If I add a connection between two nodes and edit the label using the property view and then "undo" the changes, when the undo for the label change is executed, the undo action for the ICustomUndoableFeature is also executed at the same time; although the connection isn't actually removed. If I "undo" a second time, the connection between the two nodes is removed. Once at this point, "redo" then does occur correctly.
I would appreciate it if anyone could shed some light on this behaviour.
Many thanks
Dan
Graphiti Version: 0.9.2.v20130211-0913
|
|
|
|
Re: Property View - changes cause undo problems [SOLVED] [message #1034482 is a reply to message #1034438] |
Fri, 05 April 2013 09:37  |
Eclipse User |
|
|
|
Hi Michael,
Sorry, I meant to post an update to this; I was executing my custom feature from within my property section by invoking the execute method of the superclass GFPropertySection which itself was invoking the static method executeFeatureWithContext, where the later clearly states "IMPORTANT: use this method only in situations in which you don't have an open diagram editor".
Invoking getDiagramEditor().executeFeature from within my property section resolved the problem.
Many thanks for responding.
Dan
|
|
|
Powered by
FUDForum. Page generated in 0.04770 seconds