Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Populating the Combobox of a property Dynamically(I need a combo box with names of the nodes added as compartment)
Populating the Combobox of a property Dynamically [message #532520] Mon, 10 May 2010 11:30 Go to next message
Jeno Jeyakumar Nathaniel is currently offline Jeno Jeyakumar NathanielFriend
Messages: 18
Registered: April 2010
Junior Member
Hi,

I need to populate the values of combo box dynamically which is associated to a property of Node A.Actually the values should be the names of the entities added as compartment to the nodes which are linked to the node A.

So i need the following,
1. To get the list of nodes linked.
2. To get the names of the compartment nodes added to those nodes.

Can anyone please suggest a way to do this?


Thanks,
Jeno







Re: Populating the Combobox of a property Dynamically [message #535620 is a reply to message #532520] Mon, 24 May 2010 22:29 Go to previous messageGo to next message
SebastianFriend
Messages: 8
Registered: May 2010
Junior Member
Hi Jeno,

usually the nodes shown inside a compartment are the elements of a collection feature in the underlying model object. Why not asking the model object directly? Call ((View)getModel()).getElement() on or in the appropriate editpart to get it.

If this is not possible you can traverse the hierarchy of the editpart containing the compartment view by calling getChildren() on the editpart. But this is the hierachy of diagram elements.
It depends what you consider as the "name" of a node. In the diagram hierarchy you have to traverse the editpart/figure hierarchy and look for the label (or whatever) which shows the name you are looking for.
If it is possible I recommend the first approach of asking the model object.

HTH.

Regards,
Sebastian
Re: Populating the Combobox of a property Dynamically [message #535913 is a reply to message #535620] Wed, 26 May 2010 10:19 Go to previous message
Jeno Jeyakumar Nathaniel is currently offline Jeno Jeyakumar NathanielFriend
Messages: 18
Registered: April 2010
Junior Member
Thanks Sebastian.

I am able to get the list of the nodes as a drop down.

On a different note, i just follow the below link(thread) to populate it as dropdown.

http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 7657.html

Thanks and Regards,
Jeno J
Previous Topic:EConstraint in Ecore Model
Next Topic:automate gui testing in gmf
Goto Forum:
  


Current Time: Sat Jul 27 15:41:27 GMT 2024

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

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

Back to the top