Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318747 - [Composite Structure Diagram] Undo when we change the type of a property
Summary: [Composite Structure Diagram] Undo when we change the type of a property
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 307318
  Show dependency tree
 
Reported: 2010-07-02 11:33 EDT by Vincent Lorenzo CLA
Modified: 2010-10-25 09:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.