Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318814

Summary: [Papyrus Model Explorer] Incomplete move support : cannot modify order in model explorer
Product: [Modeling] Papyrus Reporter: Yann Tanguy <yann.tanguy>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: arthur.daussy, eclipse-bugzilla
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
modification done in order to move element
none
mylyn/context/zip none

Description Yann Tanguy CLA 2010-07-04 09:50:33 EDT
Incomplete move support : cannot modify order in model explorer

In the model explorer, a element can be dragged into a new container, but an item cannot be dragged in order to change its position in the list (ex: modify attribute order in a class).
Comment 1 Patrick Tessier CLA 2010-08-17 09:07:47 EDT
Created attachment 176781 [details]
modification done in order to move element
Comment 2 Patrick Tessier CLA 2010-08-17 09:10:39 EDT
Created attachment 176782 [details]
mylyn/context/zip

impacted classes
Comment 3 Patrick Tessier CLA 2010-08-17 09:11:12 EDT
when the model explorer is not in a mode alphabetic, now it is possible to move element in the model.
To do that I have modify the common viewer in order to access to dropAdapter.

This class has in charge to parameterize the feedback.

So when the button alphabetic is pressed, feedback insertion is disable.

I have attached a UML diagram (in green the existed class, in orange the modification that I have done)
Comment 4 Yann Tanguy CLA 2012-03-08 10:32:51 EST
Current implementation does not rely on ServiceEdit and let the user do some moves whereas they are forbidden by ServiceEdit (via order+move change).
There is currently no way to change behavior by forbidding order move.

Ex: 
	Connector move to a new StructureClassifier cannot be completely forbidden and can result in the Connector disappearing from the model (model corruption)
	Moving a ConnectorEnd to a new Connector is meaningless, but even with an advice returning UnexecutableCommand, the ConnectorEnd may be moved to another Connector (try to move it between existing ends). The order also matters here, used by diagrams, but the change order gesture cannot be prevented.
	
In both previous cases, the result is an ill-formed model.

Tested on v0.9 trunk.
Comment 5 Camille Letavernier CLA 2013-05-07 08:03:52 EDT
In the current version, the drag and drop correctly relies on the Service Edit.

I close this task.
Comment 6 Arthur Daussy CLA 2013-05-16 05:11:59 EDT
Moving an element into another list with a specific index do not work when two EStructural Feature can contain the element.
For example :
 A1.1 is an OwnedBehavior A1
 We want to move A1.1 between A2.2 and A2.3 (which are children of A2 in OwnedBehavior)
 The framework should add A1.1 between A2.2 and A2.3 in the structural feature OwnedBehaviorFeature however it add A1.1 into the nested classifier of A2.

The framework should look the containing feature of A2.2 or A2.3 and use the same containing feature.

Currently working on it on the 0.8.X and backporting it soon on 0.10.X
Comment 7 Arthur Daussy CLA 2013-05-16 08:26:46 EDT
Bug corrected on 0.8.X
rev 11149.
Unable to reproduce this bug on 0.10.X even if the code is the same so I am not going to backport this code except if I succeed in reproducing.

Regards