Skip to main content



      Home
Home » Eclipse Projects » GEF » NullPointerException at org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(GraphicalEditor.ja
NullPointerException at org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(GraphicalEditor.ja [message #100867] Mon, 20 October 2003 09:52 Go to next message
Eclipse UserFriend
Originally posted by: bruno.teccomm.les.inf.puc-rio.br

I had a non functional editor before implementing createEditPolicies and
createFigure methods on my EditParts. Now I get NullPionter at
org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(Gra phicalEditor.jav
a:181).

At the time it was running, the only implemented class was the
DiagramEditPolicy. When I implemented Node and Connection the hole thing
stoped running


java.lang.NullPointerException
at
org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(Gra phicalEditor.jav
a:181)
at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEdito r.java:262)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:604)
at
org.eclipse.ui.internal.EditorManager.openInternalEditor(Edi torManager.java:
666)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager
..java:459)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:431)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2054
)
at org.eclipse.ui.internal.WorkbenchPage.access$6(WorkbenchPage .java:2004)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.ja va:1991)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:1986)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:1879)
at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:237)
at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:231)
at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:155)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1838)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1545)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.jav
a:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
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.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)
Re: NullPointerException at org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(GraphicalEdito [message #100904 is a reply to message #100867] Mon, 20 October 2003 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jpl.remotejava.com

Bruno Schroeder wrote:

> I had a non functional editor before implementing createEditPolicies and
> createFigure methods on my EditParts. Now I get NullPionter at
> org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(Gra phicalEditor.jav
> a:181).

Seems that you forgot to create an EditDomain for your editor.
I create the EditDomain instance in my editor's constructor:

setEditDomain(new DefaultEditDomain(this));

...

By the way, I think that GEF would be easier to use if conditions like
this described one did not result in NullPointerExceptions, but rather
more explicit (and earlier thrown) exceptions, for example:
IllegalStateException("EditDomain must be set before init()").

Sometimes it is easy to figure out the reason of a generic exception
by looking at the line in code where it occured, at other times it can
be quite a daunting task. Unfortunately, a design with a lot of getters
and setters (they seem to be common in GEF) makes "illegal" states
easier to enter and their early detection much more difficult.

-JPL
Re: NullPointerException at org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(GraphicalEdito [message #101096 is a reply to message #100904] Mon, 20 October 2003 14:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bruno.teccomm.les.inf.puc-rio.br

Eco my constructor:
public GoalViewEditor()

{

setEditDomain(new DefaultEditDomain(this));

//super();

}



It seems to be another problem!!! :-(


"Jan Ploski" <jpl@remotejava.com> wrote in message
news:bn0muc$14v$1@eclipse.org...
> Bruno Schroeder wrote:
>
> > I had a non functional editor before implementing createEditPolicies and
> > createFigure methods on my EditParts. Now I get NullPionter at
> >
org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(Gra phicalEditor.jav
> > a:181).
>
> Seems that you forgot to create an EditDomain for your editor.
> I create the EditDomain instance in my editor's constructor:
>
> setEditDomain(new DefaultEditDomain(this));
>
> ..
>
> By the way, I think that GEF would be easier to use if conditions like
> this described one did not result in NullPointerExceptions, but rather
> more explicit (and earlier thrown) exceptions, for example:
> IllegalStateException("EditDomain must be set before init()").
>
> Sometimes it is easy to figure out the reason of a generic exception
> by looking at the line in code where it occured, at other times it can
> be quite a daunting task. Unfortunately, a design with a lot of getters
> and setters (they seem to be common in GEF) makes "illegal" states
> easier to enter and their early detection much more difficult.
>
> -JPL
>
Re: NullPointerException at org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(GraphicalEdito [message #101123 is a reply to message #101096] Mon, 20 October 2003 15:52 Go to previous message
Eclipse UserFriend
Originally posted by: bruno.teccomm.les.inf.puc-rio.br

Actualy it seems that I had two plugins with the same id. It runned
sometimes but them it could'nt any more...

"Bruno Schroeder" <bruno@teccomm.les.inf.puc-rio.br> wrote in message
news:bn1618$m42$1@eclipse.org...
> Eco my constructor:
> public GoalViewEditor()
>
> {
>
> setEditDomain(new DefaultEditDomain(this));
>
> //super();
>
> }
>
>
>
> It seems to be another problem!!! :-(
>
>
> "Jan Ploski" <jpl@remotejava.com> wrote in message
> news:bn0muc$14v$1@eclipse.org...
> > Bruno Schroeder wrote:
> >
> > > I had a non functional editor before implementing createEditPolicies
and
> > > createFigure methods on my EditParts. Now I get NullPionter at
> > >
>
org.eclipse.gef.ui.parts.GraphicalEditor.getCommandStack(Gra phicalEditor.jav
> > > a:181).
> >
> > Seems that you forgot to create an EditDomain for your editor.
> > I create the EditDomain instance in my editor's constructor:
> >
> > setEditDomain(new DefaultEditDomain(this));
> >
> > ..
> >
> > By the way, I think that GEF would be easier to use if conditions like
> > this described one did not result in NullPointerExceptions, but rather
> > more explicit (and earlier thrown) exceptions, for example:
> > IllegalStateException("EditDomain must be set before init()").
> >
> > Sometimes it is easy to figure out the reason of a generic exception
> > by looking at the line in code where it occured, at other times it can
> > be quite a daunting task. Unfortunately, a design with a lot of getters
> > and setters (they seem to be common in GEF) makes "illegal" states
> > easier to enter and their early detection much more difficult.
> >
> > -JPL
> >
>
>
Previous Topic:Disabling context menu pop-up on right-click
Next Topic:How can i draw a connection with lables?
Goto Forum:
  


Current Time: Wed Jul 16 14:11:24 EDT 2025

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

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

Back to the top