Skip to main content



      Home
Home » Eclipse Projects » Sirius » Single-step undo
Single-step undo [message #1766838] Wed, 28 June 2017 01:05 Go to next message
Eclipse UserFriend
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 12:12 Go to previous message
Eclipse UserFriend
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
Previous Topic:A node is source of a relation only once
Next Topic:[ANN] Sirius 5.0.0
Goto Forum:
  


Current Time: Tue Jul 15 03:21:48 EDT 2025

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

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

Back to the top