Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Restricting referred objects
Restricting referred objects [message #1750218] Sun, 18 December 2016 22:01 Go to next message
Arunkumar Ramaswamy is currently offline Arunkumar RamaswamyFriend
Messages: 57
Registered: April 2014
Member
Hello

I have created a hierarchical state machine meta model and graphical editor using sirius. While creating model instance, I am selecting a reference objects in the drop down list in the properties tab. I would like to restrict the objects getting populated in the list that could be referenced. For example, state transitions should have source and target states in the same hierarchical level. How could I do this?

Any help much appreciated
Arun
Re: Restricting referred objects [message #1750255 is a reply to message #1750218] Mon, 19 December 2016 10:58 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Look at IItemPropertyDescriptor.getChoiceOfValues() and its implementations. Eventually you'll get to the generated ItemProvider and see that the default descriptor it returns is an org.eclipse.emf.edit.provider.ItemPropertyDescriptor. You can subclass this, and override for example org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getComboBoxObjects(Object)
Re: Restricting referred objects [message #1750293 is a reply to message #1750255] Mon, 19 December 2016 16:26 Go to previous messageGo to next message
Arunkumar Ramaswamy is currently offline Arunkumar RamaswamyFriend
Messages: 57
Registered: April 2014
Member
Thanks Felix for your suggestion.
Is there any way to do it using OCl in Ecore. Something that I put these constraints as OCL in Ecore and the autogenerated editors with property views restrict this population of elements.

Thanks,
Arun
Re: Restricting referred objects [message #1750296 is a reply to message #1750293] Mon, 19 December 2016 16:50 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I doubt you can use OCLinEcore directly today,.

In principle anything that is hand-coded in Java can have its data structures modelized so that all conversions are implementable as M2Ms and all state can be verified using constraints, perhaps implemented using OCLinEcore.

However few toolsmiths model everything, largely because the quality and so ease of use of modeling tools does not compare well with that of Java. We struggle to improve them, but there are rather more Java tooling developers than model tooling developers.

You could try to introduce a programmable layer for menu filtering and contribute it to the community. More likely you have deadlines and just need to get the job done yesterday. Hack it in Java.

Regards

Ed Willink
Previous Topic:I can't sort UML elements by type in model explorer or tables!
Next Topic:ConcurrentModificationException when drop a container to another parent
Goto Forum:
  


Current Time: Thu Apr 25 00:20:19 GMT 2024

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

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

Back to the top