Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330793 - [Class Diagram] DnD of enumeration Literals (in model Explorer) into Enumeration in diagram doesn't work
Summary: [Class Diagram] DnD of enumeration Literals (in model Explorer) into Enumerat...
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Patrick Tessier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-22 07:21 EST by alanusse Mising name CLA
Modified: 2011-01-12 05:42 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alanusse Mising name CLA 2010-11-22 07:21:42 EST
[Class Diagram] DnD of enumeration Literals (in model Explorer) into Enumeration in diagram doesn't work

New problem (regression?)
DnD of enumeration Literals (in model Explorer) into Enumeration in diagram doesn't work (Forbidden sign)

Old problem
In previous versions DnD was authorized but the order was not preserved when several literals were selected in the DnD
Both problems should be solved

Context
======
In a class diagram
Step1 
   Create an enumeration in the diagram
   Create 3 enumeration literals within the enumeration
   Save
The enumeration and its literals appear in the model explorer and in the diagram

Step2
   Hide the enumeration in the diagram
   
Step3
   DnD the enumeration from the model explorer into the diagram ==> OK
   
New Problem
Step4
   DnD one of the enumeration literals into the enumeration in the diagram ==> NOK (forbidden sign appear)
   it is not possible to deposit the enumeration literal within the enumeration
   
Old problem   
Spet4bis
   In previous versions DnD worked but the order of literals was not preserved when selecting several
   In model explorer select the 3 enumeration literals
   DnD them into the enumeration in the class diagram
  
   Result the enumeration literals do not appear in the same order in the diagram  as they are in the explorer.
Comment 1 Patrick Tessier CLA 2010-11-23 05:00:49 EST
The enumeration could not be be dropped because of the code for the specific drop of an instance specification(link or node).
	An enumerationLiteral is also an instance specification. Now the code contains  a condition to distinguish this element.

The second bug about the order of order of the dropped element is due to DropTargetListener class in the common. 
the selection was put into a hashSet and then the hash set was visited. In this context, the order was changed. it visits by taking account the key.

I have change it by using a ordered collection : arraylist in order to not lose the order of the selection

Done in the revision 3293

This bug will not closed, I will only change the priority.
-the job is now to code test about the   literal enumeration ( creation deletion , drop etc..) in order to detect this kind of bug automatically.
- another job: use this test case in order to pay attention that the order of the drop respect the order of the selection.
Comment 2 Patrick Tessier CLA 2010-11-23 09:13:23 EST
the test about enumeration literal has been added
revision 3296
Comment 3 Patrick Tessier CLA 2011-01-12 05:42:42 EST
done