Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Embedding EMF Forms in SWT application
[EMF Forms] Embedding EMF Forms in SWT application [message #1277625] Wed, 26 March 2014 08:44 Go to next message
Phillipp von Rotenhan is currently offline Phillipp von RotenhanFriend
Messages: 3
Registered: March 2014
Junior Member
Hi,

I have some trouble getting EMF Forms running inside an SWT Application. I followed the hints at eclipsesource.com/blogs/tutorials/emf-client-platform-how-to-customize-the-editor-layout/#embbededitor but when I try to show a EMF Forms based view inside a composite of my SWT test application I get a NullPointerException.

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.emf.ecp.view.spi.provider.ViewProviderHelper.readViewProviders(ViewProviderHelper.java:55)
	at org.eclipse.emf.ecp.view.spi.provider.ViewProviderHelper.getViewProviders(ViewProviderHelper.java:48)
	at org.eclipse.emf.ecp.view.spi.provider.ViewProviderHelper.getView(ViewProviderHelper.java:109)
	at org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl.render(ECPSWTViewRendererImpl.java:44)
	at de.test.swt.example.TreeItemSelectionListener.handleEvent(TreeItemSelectionListener.java:30)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
	at amelie.ui.swt.app.Main.main(Main.java:55)


The part where I call ECPSWTViewRenderer looks like this:
Method eobject = new Amelie_modelFactoryImpl().createMethod();
eobject.setName("New EObject");
ECPSWTViewRenderer.INSTANCE.render(MainView.getMainComposite(), eobject);	    


The project dependencies are:
* org.eclipse.swt
* org.eclipse.emf.ecp.ui.view.swt
* org.eclipse.emf.ecp.view.model.provider.generator
* org.eclipse.emf.ecp.view.model.provider.xmi
* My Ecore project
* My Ecore.edit project

I'm definitely missing something here but I can not find any decent documentation on this topic.
Re: [EMF Forms] Embedding EMF Forms in SWT application [message #1277795 is a reply to message #1277625] Wed, 26 March 2014 13:28 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

comments inline...

Am 26.03.2014 13:31, schrieb Phillipp von Rotenhan:
> Hi,
> I have some trouble getting EMF Forms running inside an SWT
> Application. I followed the hints at
> eclipsesource.com/blogs/tutorials/emf-client-platform-how-to-customize-the-editor-layout/#embbededitor
> but when I try to show a EMF Forms based view inside a composite of my
> SWT test application I get a NullPointerException.
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.eclipse.emf.ecp.view.spi.provider.ViewProviderHelper.readViewProviders(ViewProviderHelper.java:55)
>
> at
> org.eclipse.emf.ecp.view.spi.provider.ViewProviderHelper.getViewProviders(ViewProviderHelper.java:48)
>
> at
> org.eclipse.emf.ecp.view.spi.provider.ViewProviderHelper.getView(ViewProviderHelper.java:109)
>
> at
> org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl.render(ECPSWTViewRendererImpl.java:44)
>
> at
> de.test.swt.example.TreeItemSelectionListener.handleEvent(TreeItemSelectionListener.java:30)
>
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
> at amelie.ui.swt.app.Main.main(Main.java:55)

Are you running the test as a Plug-In Test? This is necessary, in this
case, the extensions are missing. If you look at the existing test cases
within ECP, you will find templates for that.
>
>
> The part where I call ECPSWTViewRenderer looks like this:
>
> Method eobject = new Amelie_modelFactoryImpl().createMethod();
> eobject.setName("New EObject");
> ECPSWTViewRenderer.INSTANCE.render(MainView.getMainComposite(),
> eobject);

Is there a reason, you use a custom factory and not the generated ones?


Best regards

Jonas

>
> The project dependencies are:
> * org.eclipse.swt
> * org.eclipse.emf.ecp.ui.view.swt
> * org.eclipse.emf.ecp.view.model.provider.generator
> * org.eclipse.emf.ecp.view.model.provider.xmi
> * My Ecore project
> * My Ecore.edit project
>
> I'm definitely missing something here but I can not find any decent
> documentation on this topic.
Re: [EMF Forms] Embedding EMF Forms in SWT application [message #1290540 is a reply to message #1277795] Thu, 10 April 2014 07:55 Go to previous messageGo to next message
Phillipp von Rotenhan is currently offline Phillipp von RotenhanFriend
Messages: 3
Registered: March 2014
Junior Member
Hi Jonas,

sorry for the delay but I had to work on other things with higher priority first.

Just to make this a little bit more clear, my application is not a test as in "unit-test" but "helloWorld" like application to figure out how to get EMF-Form running with SWT.
Anyway, I had a look at the test cases in the ECP source but I still can't figure out what dependency I'm missing. A plugin.xml of a EMF-Forms & SWT project would help me in a great way.

The custom factory was used just for some custom logging behavior but I doesn't work with the generated factory either.

Re: [EMF Forms] Embedding EMF Forms in SWT application [message #1290833 is a reply to message #1290540] Thu, 10 April 2014 13:25 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

just to be sure: Ia your final goal a non-OSGi application? This use
case is currently not supported, as EMF Forms relys on extension points
provided by core.runtime. In general it would be possible to provide a
plain Java version, too, but we would to refactor a bit for that.
If you want to be based on OSGi, then not the dependencies are the
issue, but the run configuration (which decides which bundles are
started). To get a running run configuration, I propose you start with
the feature based configuration as described in the getting started
tutorial and add your bundle to it. This way you make sure everything
required is in.

Best Regards

Jonas

Am 10.04.2014 09:55, schrieb Phillipp von Rotenhan:
> Hi Jonas,
> sorry for the delay but I had to work on other things with higher
> priority first.
>
> Just to make this a little bit more clear, my application is not a test
> as in "unit-test" but "helloWorld" like application to figure out how to
> get EMF-Form running with SWT. Anyway, I had a look at the test cases in
> the ECP source but I still can't figure out what dependency I'm missing.
> A plugin.xml of a EMF-Forms & SWT project would help me in a great way.
> The custom factory was used just for some custom logging behavior but I
> doesn't work with the generated factory either.
>
Re: [EMF Forms] Embedding EMF Forms in SWT application [message #1291710 is a reply to message #1290833] Fri, 11 April 2014 06:41 Go to previous messageGo to next message
Phillipp von Rotenhan is currently offline Phillipp von RotenhanFriend
Messages: 3
Registered: March 2014
Junior Member
Hi Jonas,

my intent was to create a non-OSGi application. Since it is no supported I will be switching to RCP, after all this is only a technology evaluation project.

Thank you for your help.
Re: [EMF Forms] Embedding EMF Forms in SWT application [message #1293467 is a reply to message #1291710] Sat, 12 April 2014 17:18 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
I am curious: What is the reason you want to avoid OSGi? It could also
be considered as a main advantage :-)
I am not sure, whether you will get happy with a RCP application without
using OSGi, too.
Best regards

Jonas

Am 11.04.2014 08:41, schrieb Phillipp von Rotenhan:
> Hi Jonas,
> my intent was to create a non-OSGi application. Since it is no supported
> I will be switching to RCP, after all this is only a technology
> evaluation project.
> Thank you for your help.
Previous Topic:[EMFForms] Indigo version
Next Topic:[EMF Facet] Need Tutorial on how to use Facet
Goto Forum:
  


Current Time: Tue Mar 19 08:05:37 GMT 2024

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

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

Back to the top