Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Parent container going null in SiriusCanonicalLayoutCommand class
Parent container going null in SiriusCanonicalLayoutCommand class [message #1806878] Fri, 17 May 2019 04:55 Go to next message
Nagashree KN is currently offline Nagashree KNFriend
Messages: 20
Registered: September 2018
Junior Member
Hi,

I am using Xtext and Sirius combination. i am editing and saving the contents from xtext . So in Sirius to arrange the elements it will be executing executeLayoutDueToExternalChanges() method in SiriusCanonicalLayoutCommand class. my problem is at the time of class instantiation diagramEditPart variable is holding parent value. but while executing the executeLayoutDueToExternalChanges() method, the varible diagramEditPart will have parent as null. because of this arranging of elements is not happening and i will get Nullpointer exception. and my stack trace is give below-

!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at org.eclipse.gef.editparts.AbstractEditPart.createChild(AbstractEditPart.java:269)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:780)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:726)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:644)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$3(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$3.run(GraphicalEditPart.java:861)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refresh(GraphicalEditPart.java:851)
at org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand$1.run(DeferredLayoutCommand.java:146)
at org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil.synchronizeRunnableToMainThread(EditPartUtil.java:111)
at org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand.doExecuteWithResult(DeferredLayoutCommand.java:186)
at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy.execute(ICommandProxy.java:68)
at org.eclipse.gef.commands.CompoundCommand.execute(CompoundCommand.java:129)
at org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutCommand.executeLayoutDueToExternalChanges(SiriusCanonicalLayoutCommand.java:109)
at org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutCommand.access$3(SiriusCanonicalLayoutCommand.java:106)
at org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutCommand$1.run(SiriusCanonicalLayoutCommand.java:92)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4213)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3820)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)


I have attached the screenshots.
Please any one help me to solve this.
Thanks in advance!
Re: Parent container going null in SiriusCanonicalLayoutCommand class [message #1807079 is a reply to message #1806878] Wed, 22 May 2019 09:37 Go to previous message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

Is it your code that do the arrange on diagram element or does it happen when you save your xtext or when you refresh the diagram?

Regards,


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Hierarchical List as Property View
Next Topic:Sirius 5->6: Unknown protocol "java" for semanticResources
Goto Forum:
  


Current Time: Fri Oct 18 08:19:38 GMT 2019

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

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

Back to the top