Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] EClass from View model cannot be resolved
[EMF Forms] EClass from View model cannot be resolved [message #1768596] Thu, 20 July 2017 11:47 Go to next message
Simon Moissl is currently offline Simon MoisslFriend
Messages: 3
Registered: July 2017
Junior Member
Hi folks,

when I try to render an SWT editor using
ECPSWTViewRenderer.INSTANCE.render(Composite, EObject)
my view model is not used.

So I debugged and found, that the method
ViewModelFileExtensionsManager.findBestFittingViews(EObject, VViewModelProperties)
knows about my model. The class's attribute
map
contains the entry for my contributed view model.

However, the key EClass is a proxy object. So it seems, that when resolving the EClass something goes wrong.
As a result, my view model contribution is not resolved as a fitting view and the default one is used to render the editor. The default editor works perfect.

I used the demo application for defining the view model by importing the model and the edit plugin into the workspace and creating a View Model Project.
Everything went well during the definition, I did not get any errors.
The generated view XML file looks similar to the example User.view file from the makeithappen example. The href attribute value of the rootEClass element looks fine syntactically. However, this URL is different to the one that can be observed in the Ecore Editor for the root class.
I tried to fix the URL in the view model file to match the one displayed in the Ecore Editor. Still the EClass could not be resolved and remains proxy in the debug session.

Do you know about the error and know of some remedy?

Thanks very much in advance!
Simon
Re: [EMF Forms] EClass from View model cannot be resolved [message #1768846 is a reply to message #1768596] Mon, 24 July 2017 10:22 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 65
Registered: September 2016
Member
Hi Simon,

is the model bundle in the run configuration? Maybe there is an error in the model configuration. Have you tried to re-generate the model from a plain Ecore and recreating the view model?
If this does not help, please provide a sample to reproduce this issue.

Best regards,
Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] EClass from View model cannot be resolved [message #1769190 is a reply to message #1768596] Thu, 27 July 2017 12:35 Go to previous messageGo to next message
Simon Moissl is currently offline Simon MoisslFriend
Messages: 3
Registered: July 2017
Junior Member
Hi Jonas,

thank you for your reply!
I still haven't found out, why the URLs are different. The model bundle is contained in the run configuration, as well as the viewmodel and the edit plugins.
The meta model is very big and contains far more than one hundred elements. There are also serialization extensions done and many more modifications on parts I still haven't discovered :)
So I've given up on that and created my own IViewProvider.

I then came across the class
org.eclipse.emf.ecp.view.model.generator.ViewProvider
.
I just wondered, why this class does not create VElements for non-containment references:
private boolean isInvalidFeature(EStructuralFeature feature) {
		return isContainerReference(feature) || isTransient(feature) || isVolatile(feature);
	}

Because when I use the editor preview feature in the demo application, these references are rendered correctly.
It also seems to work, when I create my own ViewProvider which allows for these non-containment references.
Is there a drawback or some pitfall I have to watch out if I let these references pass?

Again, thanks in advance! :)

Regards,
Simon
Re: [EMF Forms] EClass from View model cannot be resolved [message #1769445 is a reply to message #1769190] Mon, 31 July 2017 17:10 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 65
Registered: September 2016
Member
Hi Simon,

the class you are refering to produces a default view model if there is not .viewmodel for a EClass. It always produces the default layout. In this default layout, we do not show containemnt references, as they are more often shown in trees. But there is nothing wron with showing them in the form, too..

Best regards,
Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:Resource
Next Topic:checking one of the references can be created
Goto Forum:
  


Current Time: Thu Apr 19 21:38:12 GMT 2018

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

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