Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324946 - [Model Browser] loss of context when editing
Summary: [Model Browser] loss of context when editing
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Infrastructure (show other bugs)
Version: 0.9.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0 M2   Edit
Assignee: Nicolas Bros CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-10 06:49 EDT by Nicolas Bros CLA
Modified: 2010-10-18 08:39 EDT (History)
4 users (show)

See Also:
nicolas.bros: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2010-09-10 06:49:43 EDT
With Bug 324629 (editing feedback), the model browser was made to select the affected element after each editing action.

But the thing is, each model element (EObject) can appear several times in the model browser. Each such appearance corresponds to an instance of a ModelElementItem.
When the browser selects the affected element, it switches to its metaclass in the "types" panel, and selects the instance which is at the root of the "instances" tree.
This results in a loss of context (because the tree changes) if the user had gone down several model elements by successively expanding them before editing the element.

This problem stems from the fact that the affected element we get from an EMF.edit command is an EObject, and we can't find the tree node back from the EObject. So, the solution would be to not pass EObjects to commands, but instead ModelElementItems. And then make the commands themselves know how to unwrap the ModelElementItems to retrieve the EObject on which to operate.
Comment 1 Nicolas Bros CLA 2010-09-10 13:17:46 EDT
Fixed in revision 3017.
I didn't change the commands, because this would have required too many changes, with a lot of copy/pasting from EMF.edit.
Instead, I associated the editor selection with each command at its creation, in order to be able to handle the selection of the affected element in the tree (which is related to the selection).
Comment 2 Hugo Bruneliere CLA 2010-10-05 05:02:11 EDT
Bug fixed.