Community
Participate
Working Groups
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
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)); } }
We remove the semantic element associated to the compartment (the first solution) Done in r2372
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
The behavior should be delegated to the compartment itself (the ItemSemanticEditPolicy of the Compartment).
Tested on Papyrus 0.10 M5. I can't reproduce the bug. it seems be fixed, so I close it.