Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Property View - changes cause undo problems
Property View - changes cause undo problems [message #1032040] Tue, 02 April 2013 13:55 Go to next message
Dan Simkins is currently offline Dan SimkinsFriend
Messages: 38
Registered: December 2012
Member
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 [message #1034438 is a reply to message #1032040] Fri, 05 April 2013 12:30 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Dan,

what do you call to perform the changes when the label in the property sheet
is changed? Do you call a feature or work directly on EMF level? Can you
provide the coding here?

Michael
Re: Property View - changes cause undo problems [SOLVED] [message #1034482 is a reply to message #1034438] Fri, 05 April 2013 13:37 Go to previous message
Dan Simkins is currently offline Dan SimkinsFriend
Messages: 38
Registered: December 2012
Member
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
Previous Topic:Different PropertySheets for different tools
Next Topic:Update the shapes programmatically
Goto Forum:
  


Current Time: Fri Apr 19 22:45:04 GMT 2024

Powered by FUDForum. Page generated in 0.02738 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top