eclipse-modisco / org.eclipse.modisco

Eclipse Public License 2.0
0 stars 0 forks source link

[Model Browser] loss of context when editing #497

Closed eclipse-modisco-bot closed 2 hours ago

eclipse-modisco-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 324946 | | Status | CLOSED FIXED | | Importance | P3 normal | | Reported | Sep 10, 2010 06:49 EDT | | Modified | Oct 18, 2010 08:39 EDT | | Version | 0.9.0 | | Reporter | Nicolas Bros |

Description

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.

eclipse-modisco-bot commented 2 hours ago

By Nicolas Bros on Sep 10, 2010 13:17

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).

eclipse-modisco-bot commented 2 hours ago

By Hugo Bruneliere on Oct 05, 2010 05:02

Bug fixed.