Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] ReferenceService not found
[EMF Forms] ReferenceService not found [message #1270575] Thu, 13 March 2014 06:56 Go to next message
Goulwen Le Fur is currently offline Goulwen Le Fur
Messages: 125
Registered: July 2009
Senior Member
Hi,

When using EMF Forms (1.2.1) in my own editor (using the ECPSWTViewRenderer), I get the following stack:

java.lang.IllegalArgumentException: No view service of type 'org.eclipse.emf.ecp.edit.spi.ReferenceService' found.
at org.eclipse.emf.ecp.view.internal.context.ViewModelContextImpl.getService(ViewModelContextImpl.java:285)
at org.eclipse.emf.ecp.edit.spi.ECPAbstractControl.getService(ECPAbstractControl.java:296)
at org.eclipse.emf.ecp.edit.internal.swt.reference.ReferenceMultiControl.instantiateActions(ReferenceMultiControl.java:38)


Despite this error, my application is still operational.

Downloading the EMF Forms I found a solution:

If I add a dependency to the org.eclipse.emf.ecp.ui bundle and I declare the ReferenceServiceImpl with the following extension:

<extension
point="org.eclipse.emf.ecp.view.context.viewServices">
<viewService
class="org.eclipse.emf.ecp.spi.ui.ECPReferenceServiceImpl">
</viewService>
</extension>

Is it the good solution or there is a easiest way to avoid this stack ?

[Updated on: Thu, 13 March 2014 06:57]

Report message to a moderator

Re: [EMF Forms] ReferenceService not found [message #1270627 is a reply to message #1270575] Thu, 13 March 2014 08:44 Go to previous message
Jonas Helming is currently offline Jonas Helming
Messages: 457
Registered: July 2009
Senior Member
Hi Goulwen,

the reference service is required by reference controls. Only if you
have those in a form, you will need to provide this service. There are
two ways of providing it.
Either with the extension point you mentioned or by passing in your own
ViewModelContext when rendering a view. For the seocnd one, use
ViewModelContextFactory.reateViewModelContext(VElement view, EObject
domainObject,ViewModelService... modelServices).
If you only need one reference service for your App, I would use the
extension point, if you need to select while opening, use the
programmatic way.

Using the exusting ECPReferenceServiceImpl will only work for you, if
you use ECP, too, including the layer providing the ECPProject
abstraction. If you do not do that and use EMF Forms stand-alone, you
will need to implement your own custom reference service. This is
necessary, as in case of a reference control, EMF Forms needs to know
which other model elements can be referenced. This is dependending on
the layer below and abstracted by this service.

I hope this helps?

Cheers

Jonas

Am 13.03.2014 07:56, schrieb Goulwen Le Fur:
> Hi,
>
> When using EMF Forms in my own editor (using the ECPSWTViewRenderer), I
> get the following stack:
>
> java.lang.IllegalArgumentException: No view service of type
> 'org.eclipse.emf.ecp.edit.spi.ReferenceService' found.
> at
> org.eclipse.emf.ecp.view.internal.context.ViewModelContextImpl.getService(ViewModelContextImpl.java:285)
>
> at
> org.eclipse.emf.ecp.edit.spi.ECPAbstractControl.getService(ECPAbstractControl.java:296)
>
> at
> org.eclipse.emf.ecp.edit.internal.swt.reference.ReferenceMultiControl.instantiateActions(ReferenceMultiControl.java:38)
>
>
>
> Despite this error, my application is still operational.
>
> Downloading the EMF Forms I found a solution:
>
> If I add a dependency to the org.eclipse.emf.ecp.ui bundle and I
> declare the ReferenceServiceImpl with the following extension:
>
> <extension
> point="org.eclipse.emf.ecp.view.context.viewServices">
> <viewService
> class="org.eclipse.emf.ecp.spi.ui.ECPReferenceServiceImpl">
> </viewService>
> </extension>
>
> Is it the good solution or there is a easiest way to avoid this stack ?
>
>
Previous Topic:[EMF Forms] Editing composition
Next Topic:EGF Run new activity ...
Goto Forum:
  


Current Time: Thu Oct 30 19:15:43 GMT 2014

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

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