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

Bug 318747

Summary: [Composite Structure Diagram] Undo when we change the type of a property
Product: [Modeling] Papyrus Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cedric.dumoulin, vincent.lorenzo, yann.tanguy
Version: 0.7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 307318    

Description Vincent Lorenzo CLA 2010-07-02 11:33:27 EDT
Currently, we assume that a the Undo gives us a correct model, but doesn't redraw the diagram.

To redraw the diagram we need : 
	-  replace executeCommand(command);
			by executeCommandInCommandStack(command);
				in org.eclipse.papyrus.diagram.composite.custom.edit.policies.PartEditPolicy, 
	- do 2 Undo in the diagram
	
We don't choose this last solution, because if the user does only 1 Undo, the drawn model is corrupted. 
	-> We need a Undo which take the 2 last actions in the CommandStack.

Steps to Reproduce the problem: 
1. Create 2 classes, Class0 and Class1
2. Create 1 Property in Class0, named PropertyClass0
3. Create 1 Property in Class1, named PropertyClass1
4. Type PropertyClass0, with Class1
5. Drop PropertyClass1 in PropertyClass0
6. Change the type of PropertyClass0 to <Undefined>
7. Do Undo
	-> if you have replaced executeCommand(command); by  executeCommandInCommandStack(command);
				with 1 Undo, you have a bad model : 
						PropertyClass1 is redrawn, but the type is still <Undefined>
				with 2 Undo, you have a correct model
	-> if not, you have a correct model, the type is Class1, but PropertyClass is not redrawn
Comment 1 Yann Tanguy CLA 2010-10-25 09:29:20 EDT
Fixed by Bug307317.