Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] ItemPropertyDescriptor is null
[EMF Forms] ItemPropertyDescriptor is null [message #1709487] Mon, 28 September 2015 22:13 Go to next message
Klim Tow is currently offline Klim TowFriend
Messages: 49
Registered: September 2015
Member
Hi, I try to SWT-render domain objects like this:

ViewModelContext vmc = ViewModelContextFactory.INSTANCE.createViewModelContext(
					ViewProviderHelper.getView(obj, null), obj, new DefaultReferenceService());
			ECPSWTViewRenderer.INSTANCE.render(parent, vmc);


it fails at the first reference property with NPE:

java.lang.NullPointerException
at org.eclipse.emf.ecp.edit.spi.swt.reference.AddReferenceAction.<init>(AddReferenceAction.java:69)
at org.eclipse.emf.ecp.edit.internal.swt.reference.LinkControl.createButtons(LinkControl.java:146)
at org.eclipse.emf.ecp.edit.internal.swt.reference.LinkControl.fillControlComposite(LinkControl.java:122)
at org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl.createContentControl(SWTControl.java:229)
at org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl.createDataControl(SWTControl.java:159)
at org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl.createControl(SWTControl.java:125)
at org.eclipse.emf.ecp.view.internal.core.swt.renderer.ECPLegacyControlSWTRenderer.createSWTControl(ECPLegacyControlSWTRenderer.java:93)
at org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTControlSWTRenderer.createControl(SimpleControlSWTControlSWTRenderer.java:63)
at org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTRenderer.renderControl(SimpleControlSWTRenderer.java:120)
at org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer.render(AbstractSWTRenderer.java:198)
at org.eclipse.emf.ecp.view.spi.core.swt.ContainerSWTRenderer.renderControl(ContainerSWTRenderer.java:184)
at org.eclipse.emf.ecp.view.internal.core.swt.renderer.ViewSWTRenderer.renderControl(ViewSWTRenderer.java:100)
at org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer.render(AbstractSWTRenderer.java:198)
at org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl.render(ECPSWTViewRendererImpl.java:110)

the line 69 from AddReferenceAction is the following:
final IItemLabelProvider labelProvider = itemPropertyDescriptor.getLabelProvider(setting.getEObject());


That is itemPropertyDescriptor is null. Can anybody help me with this problem?
Re: [EMF Forms] ItemPropertyDescriptor is null [message #1709783 is a reply to message #1709487] Thu, 01 October 2015 06:05 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

have you added the .edit bundle of your model to the product or
run-configuration?

Best regards

Jonas


Am 30.09.2015 um 15:09 schrieb Klim Tow:
> Hi, I try to SWT-render domain objects like this:
>
> ViewModelContext vmc =
> ViewModelContextFactory.INSTANCE.createViewModelContext(
> ViewProviderHelper.getView(obj, null), obj, new
> DefaultReferenceService());
> ECPSWTViewRenderer.INSTANCE.render(parent, vmc);
>
> it fails at the first reference property with NPE:
>
> java.lang.NullPointerException
> at
> org.eclipse.emf.ecp.edit.spi.swt.reference.AddReferenceAction.<init>(AddReferenceAction.java:69)
>
> at
> org.eclipse.emf.ecp.edit.internal.swt.reference.LinkControl.createButtons(LinkControl.java:146)
>
> at
> org.eclipse.emf.ecp.edit.internal.swt.reference.LinkControl.fillControlComposite(LinkControl.java:122)
>
> at
> org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl.createContentControl(SWTControl.java:229)
>
> at
> org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl.createDataControl(SWTControl.java:159)
>
> at
> org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl.createControl(SWTControl.java:125)
>
> at
> org.eclipse.emf.ecp.view.internal.core.swt.renderer.ECPLegacyControlSWTRenderer.createSWTControl(ECPLegacyControlSWTRenderer.java:93)
>
> at
> org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTControlSWTRenderer.createControl(SimpleControlSWTControlSWTRenderer.java:63)
>
> at
> org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTRenderer.renderControl(SimpleControlSWTRenderer.java:120)
>
> at
> org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer.render(AbstractSWTRenderer.java:198)
>
> at
> org.eclipse.emf.ecp.view.spi.core.swt.ContainerSWTRenderer.renderControl(ContainerSWTRenderer.java:184)
>
> at
> org.eclipse.emf.ecp.view.internal.core.swt.renderer.ViewSWTRenderer.renderControl(ViewSWTRenderer.java:100)
>
> at
> org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer.render(AbstractSWTRenderer.java:198)
>
> at
> org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl.render(ECPSWTViewRendererImpl.java:110)
>
>
> the line 69 from AddReferenceAction is the following:
> final IItemLabelProvider labelProvider =
> itemPropertyDescriptor.getLabelProvider(setting.getEObject());
>
> That is itemPropertyDescriptor is null. Can anybody help me with this
> problem?
>


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] ItemPropertyDescriptor is null [message #1709817 is a reply to message #1709783] Thu, 01 October 2015 11:07 Go to previous messageGo to next message
Klim Tow is currently offline Klim TowFriend
Messages: 49
Registered: September 2015
Member
yes .edit bundle is included in product config

Re: [EMF Forms] ItemPropertyDescriptor is null [message #1709855 is a reply to message #1709817] Thu, 01 October 2015 13:59 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 161
Registered: May 2015
Senior Member
Hi Klim,
in the GenModel you have to set the "Property Type" of the feature to "Editable", otherwise no itemPropertyDescriptor is generated.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] ItemPropertyDescriptor is null [message #1710076 is a reply to message #1709855] Sat, 03 October 2015 20:54 Go to previous messageGo to next message
Klim Tow is currently offline Klim TowFriend
Messages: 49
Registered: September 2015
Member
thank you Eugene

is it possible to produce GenModel with "Property Type" set to "Editable" for all features / do so with an existing GenModel ?
Re: [EMF Forms] ItemPropertyDescriptor is null [message #1710126 is a reply to message #1710076] Sun, 04 October 2015 19:24 Go to previous messageGo to next message
Klim Tow is currently offline Klim TowFriend
Messages: 49
Registered: September 2015
Member
Is it OK to replace all occurrences of property="None" with property="Editable" or can it cause problems?
Re: [EMF Forms] ItemPropertyDescriptor is null [message #1710143 is a reply to message #1710126] Mon, 05 October 2015 06:13 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

the property type is a setting which influences, whether an attribute or
reference is visible in a property editor. If set to true, EMF generates
a property descriptor, which is used by EMF Forms.
EMF automatically sets all new attributes to property type editable
except containment references, as the are usually shown in a tree rather
than as properties. You can set all properties to editable, but as an
effect they would all be shown in a protery view (in case you use one).

Best regards

Jonas


Am 04.10.2015 um 21:24 schrieb Klim Tow:
> Is it OK to replace all occurrences of property="None" with
> property="Editable" or can it cause problems?


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Previous Topic: [EMFStore] Unable to integrate EMFStore with Graphiti
Next Topic:[ECP] Custom E4 Application
Goto Forum:
  


Current Time: Sun Jul 12 00:37:56 GMT 2020

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

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

Back to the top