Bug 149315 - prevent global Undo / Redo actions from nested execution
Summary: prevent global Undo / Redo actions from nested execution
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: 1.0.1   Edit
Assignee: Linda Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-06-30 11:45 EDT by Christian Vogt CLA
Modified: 2010-07-19 21:54 EDT (History)
0 users

See Also:


Attachments
patch for org.eclipse.gmf.runtime.common.ui.action (3.84 KB, patch)
2006-06-30 12:13 EDT, Christian Vogt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Vogt CLA 2006-06-30 11:45:40 EDT
Global undo / redo actions are able to be executed while one of these actions is currently running. If an undo action is currently running, and the EventLoop is run, then another undo is capable of being executed.

When doing undo / redo quickly, I found that the command (in my case it was a Delete from model command) could end up on the OperationHistory undoList multiple times even though it was only executed once. I was then able to undo the same command many times in a row, which caused errors.

I created a shared lock on the GlobalUndoAction and GlobalRedoAction doRun methods, which would skip the doRun if the lock could not be obtained, and this fixed my problem.
Comment 1 Christian Vogt CLA 2006-06-30 12:13:40 EDT
Created attachment 45600 [details]
patch for org.eclipse.gmf.runtime.common.ui.action

This is a patch of the lock I used to fix my problem. Maybe find a better way to disable the global undo / redo actions while currently executing.
Comment 2 Anthony Hunter CLA 2006-07-11 11:26:04 EDT
Linda, can you code review  ?
Comment 3 Linda Damus CLA 2006-07-13 17:40:46 EDT
Reviewed, tested and committed the patch.
Comment 4 Eclipse Webmaster CLA 2010-07-19 21:54:33 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Common was the original product and component for this bug