Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » TransactionalEditingDomain with Eclipse's IOperationHistory
TransactionalEditingDomain with Eclipse's IOperationHistory [message #1245056] Thu, 13 February 2014 08:28 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
We are using the Eclipse Workbench undo/redo mechanism (org.eclipse.core.commands.operations) along with TransactionalEditingDomain. If there are "lots of" undo commands available on the command stack and the user is pressing and holding down CTRL+Z (UNDO), commands are executed in parallel which has the effect of invalidating the model state...

Does anyone have already used the TransactionalEditingDOmain in this way and knows of a solution (or workaround)?

Thanks!
Re: TransactionalEditingDomain with Eclipse's IOperationHistory [message #1245126 is a reply to message #1245056] Thu, 13 February 2014 10:30 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Coordinating consecutive calls to UNDO/REDO using a queue seems to work... Though, if you have a better idea, let me know Smile
Re: TransactionalEditingDomain with Eclipse's IOperationHistory [message #1245218 is a reply to message #1245126] Thu, 13 February 2014 13:22 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Erdal,

It's more than a bit surprising that undo should happen in parallel.
Are you quite sure that operations are being undone actually in
parallel? I think it's more likely that somehow, because the undo is
happening on the UI thread, the job-manager-aware ILock implementation
that the TransactionalEditingDomain uses for synchronization triggers
nested UI event loops to keep the UI responsive, and these are picking
up Ctrl+Z keystrokes and performing nested (not parallel) undos.

The end result would be just as destructive to your models. But I'd
also be surprised that the operation history allows nested undo/redo
requests.

In any case, there's no way that your application should have to ensure
that commands are undone serially by queuing them. If the editing
domain is doing something that causes this behaviour (which I think
must be the case), it behooves the editing domain to do what it takes
to ensure serial execution of undo/redo.

Cheers,

Christian


On 2014-02-13 10:30:35 +0000, Erdal Karaca said:

> Coordinating consecutive calls to UNDO/REDO using a queue seems to
> work... Though, if you have a better idea, let me know :)
Re: TransactionalEditingDomain with Eclipse's IOperationHistory [message #1245235 is a reply to message #1245218] Thu, 13 February 2014 13:56 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Hi Christian,
Thanks, you are absolutely right: there are nested calls (triggered inside command execution) rather than parallel executions.

Though, as said, it is sufficient to make the undo/redo handlers aware of nested undo/redo calls.

Christian W. Damus wrote on Thu, 13 February 2014 14:22
Hi, Erdal,

It's more than a bit surprising that undo should happen in parallel.
Are you quite sure that operations are being undone actually in
parallel? I think it's more likely that somehow, because the undo is
happening on the UI thread, the job-manager-aware ILock implementation
that the TransactionalEditingDomain uses for synchronization triggers
nested UI event loops to keep the UI responsive, and these are picking
up Ctrl+Z keystrokes and performing nested (not parallel) undos.

The end result would be just as destructive to your models. But I'd
also be surprised that the operation history allows nested undo/redo
requests.

In any case, there's no way that your application should have to ensure
that commands are undone serially by queuing them. If the editing
domain is doing something that causes this behaviour (which I think
must be the case), it behooves the editing domain to do what it takes
to ensure serial execution of undo/redo.

Cheers,

Christian


On 2014-02-13 10:30:35 +0000, Erdal Karaca said:

> Coordinating consecutive calls to UNDO/REDO using a queue seems to
> work... Though, if you have a better idea, let me know Smile

Previous Topic:Eclipse UML Profiles Repository now available!
Next Topic:[CDO?] Notifications when reference is set to 'null'
Goto Forum:
  


Current Time: Thu Apr 25 15:35:15 GMT 2024

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

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

Back to the top