Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » TransactionalEditingDomain is null
TransactionalEditingDomain is null [message #560145] Tue, 21 September 2010 10:52 Go to next message
mjid is currently offline mjidFriend
Messages: 34
Registered: April 2010
Member
Hi,
I want to display my diagram into view so when i do viewer.setContents(diagram) i get this error :

java.lang.NullPointerException
at org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPar tService.createEditPart(EditPartService.java:226)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents( AbstractEditPartViewer.java:611)
at org.example.test.diagram.view.ModelElement.updateSelection(M odelElement.java:184)
at org.example.test.diagram.view.ModelElement.selectionChanged( ModelElement.java:129)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2132)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1160)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1190)
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:228)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:222)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:389)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3503)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.example.test.diagram.view.Generate.run(Generate.java:101 )
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

This is because the TransactionalEditingDomain is null.
So how to resolve this?

Thanks in advance,
mjid
Re: TransactionalEditingDomain is null [message #626314 is a reply to message #560145] Wed, 22 September 2010 13:54 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,

It's hard to imagine the editing domain being null in a standard
generated GMF diagram. look in the xxxDocumentProvider, you will see
that a Domain Editor is created there.

But you talk about a viewer, Is this some customization? What exactly
are you modifying?

cheers Christophe


On 21-09-10 12:52, mjid wrote:
> Hi,
> I want to display my diagram into view so when i do
> viewer.setContents(diagram) i get this error :
>
> java.lang.NullPointerException
> at org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPar
> tService.createEditPart(EditPartService.java:226)
> at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(
> AbstractEditPartViewer.java:611)
> at org.example.test.diagram.view.ModelElement.updateSelection(M
> odelElement.java:184)
> at org.example.test.diagram.view.ModelElement.selectionChanged(
> ModelElement.java:129)
> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.core.runtime.Platform.run(Platform.java:888)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
> at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
> at org.eclipse.jface.viewers.StructuredViewer.updateSelection(S
> tructuredViewer.java:2132)
> at org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru
> cturedViewer.java:1160)
> at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(
> StructuredViewer.java:1190)
> at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS
> trategy.java:228)
> at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:222)
> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate
> gy.java:389)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3910)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3503)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
> at org.eclipse.jface.window.Window.open(Window.java:801)
> at org.example.test.diagram.view.Generate.run(Generate.java:101 )
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi
> on.java:251)
> at org.eclipse.jface.action.ActionContributionItem.handleWidget
> Selection(ActionContributionItem.java:584)
> at org.eclipse.jface.action.ActionContributionItem.access$2(Act
> ionContributionItem.java:501)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEven
> t(ActionContributionItem.java:411)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3910)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3503)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault
> (Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
> bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start
> (IDEApplication.java:113)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
> eAppHandle.java:194)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .runApplication(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .start(EclipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:179)
> 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: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>
> This is because the TransactionalEditingDomain is null.
> So how to resolve this?
>
> Thanks in advance,
> mjid
Re: TransactionalEditingDomain is null [message #626315 is a reply to message #626314] Wed, 22 September 2010 13:54 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 22-09-10 15:54, Christophe Bouhier wrote:
> you will see that a Domain Editor
heu...It should be an editing domain
Re: TransactionalEditingDomain is null [message #626430 is a reply to message #626315] Wed, 22 September 2010 14:46 Go to previous message
mjid is currently offline mjidFriend
Messages: 34
Registered: April 2010
Member
Hi Christophe,

viewer is a type of GraphicalViewer wich i defined in my plugin to display my activity diagram into view.
I resolved the problem TransactionalEditingDomain is null by adding this:
TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain(resourceSet);

but the problem now is that my diagram is not displayed correctly into view.

What kind of implementation (GraphicalEditPolicy ,Layout..)can i do to make my activity diagram very nice Smile?

Cheers,
mjid
Previous Topic:Index of ordered list as property
Next Topic:CreateView question
Goto Forum:
  


Current Time: Thu Apr 25 01:17:36 GMT 2024

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

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

Back to the top