Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EWL] How to order selected elements
[EWL] How to order selected elements [message #1660754] Mon, 09 March 2015 10:18 Go to next message
Daria Sukmanova is currently offline Daria SukmanovaFriend
Messages: 5
Registered: March 2015
Junior Member
Hi all,

I work on wizard, that creats a generalization link between 2 classes.

my guard section is
guard{
var class1 : ecore::EClass;
var class2 : ecore::EClass;
if (self.isTypeOf (Collection) and self.size() = 2
and self.forAll(s|s.isTypeOf(ecore::EClass))){
class1 = self.at(0);
class2 = self.at(1);
}
return class1.isDefined() and class2.isDefined();
}

I want to create a link from class1 to class2, but when I selected 2 elements in the model - they are ordered in Collection not in the way I have chosen them (but alphabetically).

Example: classes A and B in the model
try to select A then B - Collection:(A,B)
try to select B then A - Collection:(A,B) also

I also tried to use .last() method and result was the same
How can I overcome it?
Re: [EWL] How to order selected elements [message #1662462 is a reply to message #1660754] Tue, 10 March 2015 02:44 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi Daria,

Unfortunately, the EMF editor does not preserve the order in which elements were selected (this is a more general issue [1]) so I'm afraid there's not much we can do about this.

Cheers,
Dimitris

[1] http://stackoverflow.com/questions/12977794/get-the-order-of-selection-from-an-istructuredselection

[Updated on: Tue, 10 March 2015 02:45]

Report message to a moderator

Re: [EWL] How to order selected elements [message #1663472 is a reply to message #1662462] Tue, 10 March 2015 12:44 Go to previous message
Daria Sukmanova is currently offline Daria SukmanovaFriend
Messages: 5
Registered: March 2015
Junior Member
Thanks a lot, Dimitris!
Previous Topic:[EGL][Solved] Using EGL to generate another EGL script
Next Topic:[ETL] [Solved] - model output empty
Goto Forum:
  


Current Time: Thu Apr 18 10:30:08 GMT 2024

Powered by FUDForum. Page generated in 0.01575 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top