Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Index of ordered list as property(How to let users modify the order of elements through properties)
Index of ordered list as property [message #559854] Mon, 20 September 2010 06:20 Go to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Hello,

I am currently developping an editor in which the user can drop blocks with inputs/outputs and link them together (similar as an electronic logic diagram). From this diagram, I should generate code. However, the execution order of the elements is important and currently, the execution order is the order in which the user added the blocks to the diagram.
I would like the user to be able to change the order of the blocks through the properties of the block.

The blocks are contained in an ordered list. I would like to add a property "execution order" which displays the index of the element in the list. The user should be able to modify this index (with the consequence that the index of other elements are adapted too of course).

Is there an easy way to implement this ?

Thanks
Re: Index of ordered list as property [message #625309 is a reply to message #559854] Wed, 22 September 2010 08:13 Go to previous message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Maybe my approach isn't correct ?
Is there any way to let the user control the order of elements in an ordered list ? Should I maybe add a property "index" in the blocks properties, then use a model to model transformation to reorder the elements properly depending on this index ?

But this sounds like a rather complicated solution to me. Furthermore, when the index of one element is changed, the index of other elements should be adapted too (to avoid duplication of indices or gaps in the sequence).

Another approach would be to be able to add "custom" properties in the property view. And for such a custom property you could provide a getter and setter (the getter would simply return the index of the element in the ordered list and the setter would simply insert the element at the requested position). Is there any way to provide a property which is not part of the model element to the properties view ?
Previous Topic:Two diagrams, same domain model: duplication of the top level node in the project explorer
Next Topic:TransactionalEditingDomain is null
Goto Forum:
  


Current Time: Thu Oct 31 22:52:14 GMT 2024

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

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

Back to the top