Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319507 - [General] Delete from Model on a compartment, remove only the compartment
Summary: [General] Delete from Model on a compartment, remove only the compartment
Status: CLOSED 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: 0.7.0   Edit
Assignee: Vincent Lorenzo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 03:05 EDT by Vincent Lorenzo CLA
Modified: 2013-03-13 06:40 EDT (History)
1 user (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-12 03:05:56 EDT
When we do a Delete From Model on a compartment, this action removes only the compartment and not the semantic element.
So, it' looks like the Delete from Diagram action, this is not logical. This action should be modified to do a real Delete From Model.
Two solutions : 
	1/ Delete the semantic element owning the compartment
	2/ Delete all the elements owned by the compartment
Comment 1 Vincent Lorenzo CLA 2010-07-12 11:37:32 EDT
in DeleteFromModelAction Replace 

		while(editParts.hasNext()) {
			EditPart editPart = (EditPart)editParts.next();
			Command curCommand = editPart.getCommand(request);
			if(curCommand != null) {
				command.compose(new CommandProxy(curCommand));
			}

		}
			

by
			
			while(editParts.hasNext()) {
			EditPart editPart = (EditPart)editParts.next();
			//Delete From Model on a compartment, remove the editpart owning the parent.
			if((editPart instanceof CompartmentEditPart)) {
				editPart = editPart.getParent();
			}
			Command curCommand = editPart.getCommand(request);
			if(curCommand != null) {
				command.compose(new CommandProxy(curCommand));
			}

		}
Comment 2 Vincent Lorenzo CLA 2010-07-13 08:53:09 EDT
We remove the semantic element associated to the compartment (the first solution)
Done in r2372
Comment 3 Vincent Lorenzo CLA 2010-07-23 09:41:25 EDT
Reopen because in class diagram a property is a CompartmentEditPart, also, when we want to delete a property, we remove the compartment! see bug 320384
Comment 4 Yann Tanguy CLA 2010-08-23 06:21:50 EDT
The behavior should be delegated to the compartment itself (the ItemSemanticEditPolicy of the Compartment).
Comment 5 Vincent Lorenzo CLA 2013-03-13 06:40:50 EDT
Tested on Papyrus 0.10 M5. I can't reproduce the bug. it seems be fixed, so I close it.