Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Single-step undo
Single-step undo [message #1766838] Wed, 28 June 2017 05:05 Go to next message
Iain Whiteside is currently offline Iain WhitesideFriend
Messages: 17
Registered: June 2016
Junior Member
Hi all,

I am implementing some keyboard shortcuts to create nodes in my diagram. If a node is selected when the shortcut is pressed, an edge and a new node will be created (and layout performed).

I have an implementation that works (by creating the EMF objects by emf commands applied on the command stack obtained from the session, then letting sirius take care of providing the rendering and layout).

However, it seems that the addition of the diagram element and the layout process are multiple steps, so three undos are actually required. This isn't ideal.

Can anyone point me to a better way to do this?
Re: Single-step undo [message #1766904 is a reply to message #1766838] Wed, 28 June 2017 16:12 Go to previous message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 177
Registered: October 2014
Senior Member
Hello

When using the Transactional Editing Domain commandStack of the Sirius Session to execute an EMF command, some Sirius precommit listener are called to refresh the diagram that is the change done in the command and the diagram refresh is done in the same EMF transaction. So the undo should undo all the changes.

Perhaps can you provide more precision. You could try to execute your code in a tool defined in the VSM (in that case the java code is already encapsulated in a EMF command executed in the right commandStack)

I am also curious how you did to associate a keyboard shortcut to your command. Feel free to give me some info ;)

regards
Laurent


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:A node is source of a relation only once
Next Topic:[ANN] Sirius 5.0.0
Goto Forum:
  


Current Time: Sun Feb 28 13:57:24 GMT 2021

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

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

Back to the top