Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314562

Summary: [Undo/Redo] Undo/redo generall broken - undo options depend on selected diagram/model explorer
Product: [Modeling] Papyrus Reporter: Ansgar Radermacher <ansgar.radermacher>
Component: CoreAssignee: Cedric Dumoulin <cedric.dumoulin>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: 0.7.0   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on: 314250    
Bug Blocks:    

Description Ansgar Radermacher CLA 2010-05-26 15:45:30 EDT
Build Identifier: 

The behavior of the Undo/Redo options are different whether an element within the (Papyrus) model explorer or a diagram (e.g. class) is selected.

Apparently, different stacks (or undo contexts?) are used.

In general, all diagrams (of the same model) and the model explorer should operate on the same command stack and use consistent labeling.

Another issue: If a command has been invoked originally from a diagram which is currently not active, this diagram should be re-activated (which is quite similiar to editing a large text: if the undo affects a part that is not visible most editors set the cursor to the original place). This should be the case, even as model edit operations can potentially affect multiple diagram - but there is a single diagram in which the original command has been issued

Reproducible: Always

Steps to Reproduce:
1. Select an element in the model explorer
2. Rename it. Observation: The Undo menu item only shows the label "undo", i.e. no further information which operation would be undone (unlike if the same operation is done within a diagram, see below)
4. Now select an element in a diagram. Observation: Undo is no longer available.
5. Now select an element in the model explorer: Observation: Undo is again available (and does the right thing, if called)

---

1. Make an editing operation in a diagram: Observation: undo label with additional information.
2. Select element in model explorer: Observation: undo label without additional information, but still operational.
Comment 1 Cedric Dumoulin CLA 2010-05-28 10:47:38 EDT
This is linked to bug 314250.
Comment 2 Cedric Dumoulin CLA 2010-06-25 10:59:24 EDT
Now the IOperationHistory is used to store executed Commands. Commands are executed in different stack, all following back on the IOperationHistory.
There is a document about the Command frameworks that will be commited soon (see bug 314250).
The problem of giving focus on a diagram is note treated now. A solution can be to store the diagram switch as commands.
Comment 3 Ansgar Radermacher CLA 2010-09-06 10:14:32 EDT
Fixed by Cedrics modifications. Thanks