Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Values not set
[EMF Forms] Values not set [message #1412919] Wed, 27 August 2014 11:02 Go to next message
Marco Descher is currently offline Marco DescherFriend
Messages: 171
Registered: October 2010
Location: Austria
Senior Member
Hy there,

I am getting more and more into EMF Forms, but now I have the problem that changes on the properties are not set to the EObject.

That is, I have registered an Adapter on the EObject to inform me about changes, and there are definitely none happening in my view. There is also no log output or something!

I first thought about a resource save problem, as http://eclipsesource.com/blogs/2014/04/15/emf-forms-a-question-of-effort/ Mario had here, but it seems to be the properties simply not being databinded?!

This is 1.4.0_M4

thanks!
Re: [EMF Forms] Values not set [message #1412925 is a reply to message #1412919] Wed, 27 August 2014 11:22 Go to previous messageGo to next message
Marco Descher is currently offline Marco DescherFriend
Messages: 171
Registered: October 2010
Location: Austria
Senior Member
Maybe this got to do with the XCore Backend I am using, where I generate the required ecore and genmodel files out. On selecting "Create and link domain model reference" on a property nothing happens, with the following exception occuring in the log:

org.eclipse.emf.common.util.WrappedException: java.lang.ClassCastException: org.eclipse.emf.ecore.xcore.impl.XPackageImpl cannot be cast to org.eclipse.emf.ecore.EPackage
	at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor$Dynamic.getEPackage(RegistryReader.java:255)
	at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
	at org.eclipse.emf.ecp.core.util.ECPUtil.getSubClasses(ECPUtil.java:146)
	at org.eclipse.emf.ecp.view.editor.controls.DomainModelReferenceControlSWTRenderer$SelectionAdapterExtension.widgetSelected(DomainModelReferenceControlSWTRenderer.java:325)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4031)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3658)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.xcore.impl.XPackageImpl cannot be cast to org.eclipse.emf.ecore.EPackage
	at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor$Dynamic.getEPackage(RegistryReader.java:246)
	... 33 more

[Updated on: Wed, 27 August 2014 11:28]

Report message to a moderator

Re: [EMF Forms] Values not set [message #1412940 is a reply to message #1412925] Wed, 27 August 2014 11:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31005
Registered: July 2009
Senior Member
Marco,

What's in your model's plugin.xml?

The latest maintenance stream is more careful to use

return (EPackage)
EcoreUtil.getObjectByType(resourceSet.getResource(locationURI,
true).getContents(), EcorePackage.Literals.EPACKAGE);

If your location includes a fragment, it needs to point at the right
index within the resource, i.e., just "#/" will select the XPackage. As
a workaround if you're using a slightly older version of EMF, you can
use "#/EPackage" to refer to the EPackage in the *.xcore resources.

I'm not sure that will really work though, because a *.xcore needs a
classpath provider to resolve imports...



On 27/08/2014 1:22 PM, Marco Descher wrote:
> Maybe this got to do with the XCore Backend I am using, where I
> generate the required ecore and genmodel files out. On selecting
> "Create and link domain model reference" on a property nothing
> happens, with the following exception occuring in the log:
>
>
> org.eclipse.emf.common.util.WrappedException:
> java.lang.ClassCastException:
> org.eclipse.emf.ecore.xcore.impl.XPackageImpl cannot be cast to
> org.eclipse.emf.ecore.EPackage
> at
> org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor$Dynamic.getEPackage(RegistryReader.java:255)
> at
> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
> at
> org.eclipse.emf.ecp.core.util.ECPUtil.getSubClasses(ECPUtil.java:146)
> at
> org.eclipse.emf.ecp.view.editor.controls.DomainModelReferenceControlSWTRenderer$SelectionAdapterExtension.widgetSelected(DomainModelReferenceControlSWTRenderer.java:325)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
> at
> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4031)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3658)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
> at
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
> Caused by: java.lang.ClassCastException:
> org.eclipse.emf.ecore.xcore.impl.XPackageImpl cannot be cast to
> org.eclipse.emf.ecore.EPackage
> at
> org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor$Dynamic.getEPackage(RegistryReader.java:246)
> ... 33 more
>
Re: [EMF Forms] Values not set [message #1412944 is a reply to message #1412925] Wed, 27 August 2014 12:00 Go to previous message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 63
Registered: March 2012
Member
Hi,
yes you can't configure the view model because of the ClassCastException.
We already have a bug open for XCore support: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440329
We are happy to accept contributions which would fix those problems.

Cheers,
Eugen
Previous Topic:Use EMF Forms to modify forms
Next Topic:[EMF FORMS] Major error if the store is not reachable
Goto Forum:
  


Current Time: Wed Apr 01 00:23:03 GMT 2020

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

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

Back to the top