Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Providers dynamically
EMF Providers dynamically [message #1047537] Tue, 23 April 2013 10:52 Go to next message
Dhanya M is currently offline Dhanya MFriend
Messages: 19
Registered: April 2013
Junior Member
Hi,

I have an EMF model which is used in a TreeViewer. On right click on tree, by default EMF provides the list of possible children. I want to modify this child list (show only few children) based on some conditions dynamically. Similarly the property descriptors list also need to be modified. What is the best possible way to achieve this?

Dynamic behavior is because the conditions are added based on the user inputs.

Thanks.
Dhanya
Re: EMF Providers dynamically [message #1047755 is a reply to message #1047537] Tue, 23 April 2013 15:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33108
Registered: July 2009
Senior Member
Dhanya,

You'd need to specialize the generated item provider(s) that produce
these things.


On 23/04/2013 2:46 PM, Dhanya M wrote:
> Hi,
>
> I have an EMF model which is used in a TreeViewer. On right click on
> tree, by default EMF provides the list of possible children. I want to
> modify this child list (show only few children) based on some
> conditions dynamically. Similarly the property descriptors list also
> need to be modified. What is the best possible way to achieve this?
>
> Dynamic behavior is because the conditions are added based on the user
> inputs.
>
> Thanks.
> Dhanya


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF Providers dynamically [message #1048130 is a reply to message #1047755] Wed, 24 April 2013 04:46 Go to previous messageGo to next message
Dhanya M is currently offline Dhanya MFriend
Messages: 19
Registered: April 2013
Junior Member
Currently what i have done is modify each providers newChildDescriptors collection in collectNewChildDescriptors(..) method. Is that the correct approach?
Re: EMF Providers dynamically [message #1048161 is a reply to message #1048130] Wed, 24 April 2013 05:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33108
Registered: July 2009
Senior Member
Dhanya,

Those are responsible for the choices the context menus, so yes, if you
want to modify that too, that's how you'd do it...


On 24/04/2013 6:46 AM, Dhanya M wrote:
> Currently what i have done is modify each providers
> newChildDescriptors collection in collectNewChildDescriptors(..)
> method. Is that the correct approach?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF Providers dynamically [message #1048175 is a reply to message #1047537] Wed, 24 April 2013 06:08 Go to previous messageGo to next message
Dhanya M is currently offline Dhanya MFriend
Messages: 19
Registered: April 2013
Junior Member
Thanks.

Also is there a possibility to restrict the enumerators values in Properties view?
Eg: If I have an Enumerator with values A,B,C,D and I want to show only A and B based on some conditions in the properties view, is it possible?
Re: EMF Providers dynamically [message #1048225 is a reply to message #1048175] Wed, 24 April 2013 07:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33108
Registered: July 2009
Senior Member
Dhanya,

Yes, you can specialize the property descriptor's getChoiceOfValues.

On 24/04/2013 8:08 AM, Dhanya M wrote:
> Thanks.
>
> Also is there a possibility to restrict the enumerators values in
> Properties view?
> Eg: If I have an Enumerator with values A,B,C,D and I want to show
> only A and B based on some conditions in the properties view, is it
> possible?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] DBAdapter.readFields (Out of memory)
Next Topic:EMF search problem
Goto Forum:
  


Current Time: Tue Mar 19 10:36:06 GMT 2024

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

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

Back to the top