|Re: [EMF Forms] How to select specific view model for view [message #1746400 is a reply to message #1746371]
||Fri, 28 October 2016 07:48
| Eugen Neufeld
Registered: May 2015
Hi Bob, |
The way the TreeMasterDetail does this is the easiest one. In this case when you request a View Model using the ViewProviderHelper, you can pass in VViewModelProperties which are basically Key-Value Pairs.
You can pass in multiple such properties and when you register you view models then the one that satisfies most of the properties will be taken.
The alternative would be to provide you own IViewProvider (As an OSGi-Service or register it on an extension point). Here you will have to load/create the view models by yourself and return the correct one based on the passed in EObject and VViewModelProperties.
I would only recommend to do this, if you want to filter your view models based on some attribute value, so in a dynamic way.
Get professional Eclipse developer support:
Powered by FUDForum
. Page generated in 0.01286 seconds