Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Undo a feature
Undo a feature [message #1100923] Tue, 03 September 2013 20:03 Go to next message
Jack Chi is currently offline Jack ChiFriend
Messages: 26
Registered: July 2011
Location: Pennsylvania
Junior Member

Hi,

In an update feature, I modify an Graphic Algorithm Text object using an EMF object. Then I invoke undo by pressing Ctrl-z. I wonder if there some mechanism available to sync the Text value and EMF object after an undo is performed?

Thanks

Jack
Re: Undo a feature [message #1101428 is a reply to message #1100923] Wed, 04 September 2013 12:51 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1635
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Jack,

if the change to the EMF object and the Graphic Algorithm Text were done in
one Graphiti feature or one EMF Transaction then undo would so both.

In case the EMF object has been modified externally you can implement that
additional undo by implementing ICustomUndoableFeature in your update
feature and implement undo to make your changes.

Michael
Re: Undo a feature [message #1102354 is a reply to message #1101428] Thu, 05 September 2013 17:25 Go to previous messageGo to next message
Jack Chi is currently offline Jack ChiFriend
Messages: 26
Registered: July 2011
Location: Pennsylvania
Junior Member

Michael,

Is there any setup step for the ICustomUndoableFeature to work in 0.9.2? I tried this before, the undo method is not invoked by pressing ctrl-z a few times in sequence.

My feature is an update feature, I modify the EMF model from a property view. After that, I invoke the update feature to display the new model value in a Text graphic algorithm. I repeated this step for a few times before I press ctrl-z key a few time.
I thought the update feature's undo method should be invoked at this point. But it is not invoked.

Do I need to set up the link between ctrl-z and this update feature. Just some thoughts.

Thanks

Jack
Re: Undo a feature [message #1108231 is a reply to message #1102354] Fri, 13 September 2013 14:38 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1635
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Jack,

not sure what causes that, just some thoughs...

You might check the undo is done in the rigth editing domain. If it happens
from the property sheet it might get mixed up with another one. Also CTRL-Z
is bound in SWT text fields, in case the focus is still there or the command
binding might was not reset to the editor it might simply be the field undo
that gets executed...

Michael
Previous Topic:Graphiti for web development
Next Topic:Extending the Graphiti Metamodel
Goto Forum:
  


Current Time: Thu Nov 27 12:08:51 GMT 2014

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

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