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.
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.