Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Modify behaviour for GFWorkspaceCommandStackImpl.redo() ?(So that EMF redo takes place AFTER the non-EMF one)
Modify behaviour for GFWorkspaceCommandStackImpl.redo() ? [message #1416091] Thu, 04 September 2014 09:52 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi all,

I use Graphiti to work on diagrams with - of course - modifications to my underlying EMF business models.
These models as well as the Graphiti diagrams are stored in a CDO repository shared with other users.
Therefore, before I perform any change through my Graphiti features, I have to acquire a write lock on the modified elements.
Moreover my features can be undone and redone.
For undo, this basically means that modifications are undone before the lock is released.
While, for redo, locking should take place before the modifications are redone.

All this lock/unlock handling is implemented in my features undo and redo methods.

But I found out that GFWorkspaceCommandStackImpl.redo applies EMF redo before the non-EMF one, that is, before executing my features redo that care about re-acquiring the necessary lock.

A workaround to my problem is to provide a slightly modified implementation of the GFWorkspaceCommandStackImpl class, in the redo method, to invert the execution so that EMF redo now takes place after the non-EMF one.

But I was wondering if this change could / should be integrated to the Graphiti framework ?

Kind regards,

Laurent
Re: Modify behaviour for GFWorkspaceCommandStackImpl.redo() ? [message #1416116 is a reply to message #1416091] Thu, 04 September 2014 11:03 Go to previous messageGo to next message
Martin Hanysz is currently offline Martin HanyszFriend
Messages: 30
Registered: November 2013
Member
Hi Laurent,

It sounds like we need preUndo() and postUndo() methods. This way, the current and your needed behavior would be supported.

Best regards,
Martin
Re: Modify behaviour for GFWorkspaceCommandStackImpl.redo() ? [message #1416126 is a reply to message #1416116] Thu, 04 September 2014 11:43 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi Martin,

You're right. I just filled an enhancement request :

https://bugs.eclipse.org/bugs/show_bug.cgi?id=443304

Regards,

Laurent
Re: Modify behaviour for GFWorkspaceCommandStackImpl.redo() ? [message #1434505 is a reply to message #1416126] Tue, 30 September 2014 07:10 Go to previous messageGo to next message
Krisztian Koncz is currently offline Krisztian KonczFriend
Messages: 31
Registered: September 2014
Location: Budapest
Member

Last week, I found another problem with the current implementation. I wanted to use CommandstackListener and ICustomUndoableFeatures. The problem is, only the EMF undo and redo notify the listeners, and this notification is before the customundoablefeature undo. I could manage this problem, I created my custom Commandstack implementation, inherited from the GFWorkspaceCommandStackImpl, and added new type of listeners. This listeners invoked after the customundofeature undo and redo.
Re: Modify behaviour for GFWorkspaceCommandStackImpl.redo() ? [message #1438828 is a reply to message #1434505] Mon, 06 October 2014 14:58 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
That hook will be part of the enhancement coming with the bugzilla Laurent
opened:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=443304

Michael
Previous Topic:Supported fonts
Next Topic:Custom Text
Goto Forum:
  


Current Time: Tue Mar 19 07:53:16 GMT 2024

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

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

Back to the top