Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » problem with undo command
problem with undo command [message #132205] Fri, 14 May 2004 15:42 Go to next message
Eclipse UserFriend
Originally posted by: paolino125.hotmail.com

Hi, I'm building a graphical editor with gef. Look at flow example I've
implemented a deleteCommand; when i delete a figure all works, but when I
try to undo the command I get:

java.lang.NullPointerException

at
org.eclipse.gef.editparts.AbstractEditPart.getRoot(AbstractE ditPart.java:580
)

at
org.eclipse.gef.editparts.AbstractEditPart.getViewer(Abstrac tEditPart.java:6
30)

at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.createOr FindConnection(A
bstractGraphicalEditPart.java:285)

at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshT argetConnections
(AbstractGraphicalEditPart.java:640)

at
org.eclipse.dylog.editors.graphical.part.ActivityPart.proper tyChange(Activit
yPart.java:107)

at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)

at org.eclipse.dylog.model.Activity.firePropertyChange(Activity .java:81)

at org.eclipse.dylog.model.Activity.addTargetConnection(Activit y.java:99)

at
org.eclipse.dylog.model.command.DeleteCommand.restoreConnect ions(DeleteComma
nd.java:88)

at
org.eclipse.dylog.model.command.DeleteCommand.undo(DeleteCom mand.java:115)

at org.eclipse.gef.commands.CompoundCommand.undo(CompoundComman d.java:169)

at org.eclipse.gef.commands.CommandStack.undo(CommandStack.java :229)

....

It seems that the editPart I've added dosn't have a parent!Idon't understand
how it's possible!

Please help me. Thanks
Re: problem with undo command [message #132350 is a reply to message #132205] Mon, 17 May 2004 13:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It sounds like you have a dangling EditPart which is still listening to the
model. Make sure you unhook and model listeners in deactivate(), and allow
the editparts to get GCed.

"funky79" <paolino125@hotmail.com> wrote in message
news:c82ovk$26b$1@eclipse.org...
> Hi, I'm building a graphical editor with gef. Look at flow example I've
> implemented a deleteCommand; when i delete a figure all works, but when I
> try to undo the command I get:
>
> java.lang.NullPointerException
>
> at
>
org.eclipse.gef.editparts.AbstractEditPart.getRoot(AbstractE ditPart.java:580
> )
>
> at
>
org.eclipse.gef.editparts.AbstractEditPart.getViewer(Abstrac tEditPart.java:6
> 30)
>
> at
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.createOr FindConnection(A
> bstractGraphicalEditPart.java:285)
>
> at
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshT argetConnections
> (AbstractGraphicalEditPart.java:640)
>
> at
>
org.eclipse.dylog.editors.graphical.part.ActivityPart.proper tyChange(Activit
> yPart.java:107)
>
> at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
>
> at org.eclipse.dylog.model.Activity.firePropertyChange(Activity .java:81)
>
> at org.eclipse.dylog.model.Activity.addTargetConnection(Activit y.java:99)
>
> at
>
org.eclipse.dylog.model.command.DeleteCommand.restoreConnect ions(DeleteComma
> nd.java:88)
>
> at
> org.eclipse.dylog.model.command.DeleteCommand.undo(DeleteCom mand.java:115)
>
> at org.eclipse.gef.commands.CompoundCommand.undo(CompoundComman d.java:169)
>
> at org.eclipse.gef.commands.CommandStack.undo(CommandStack.java :229)
>
> ...
>
> It seems that the editPart I've added dosn't have a parent!Idon't
understand
> how it's possible!
>
> Please help me. Thanks
>
>
Re: problem with undo command [message #132387 is a reply to message #132350] Mon, 17 May 2004 13:41 Go to previous message
Eclipse UserFriend
Originally posted by: paolino125.hotmail.com

Yes, it's right!
Thanks!

"Randy Hudson" <none@us.ibm.com> ha scritto nel messaggio
news:c8aejs$37q$1@eclipse.org...
> It sounds like you have a dangling EditPart which is still listening to
the
> model. Make sure you unhook and model listeners in deactivate(), and
allow
> the editparts to get GCed.
>
> "funky79" <paolino125@hotmail.com> wrote in message
> news:c82ovk$26b$1@eclipse.org...
> > Hi, I'm building a graphical editor with gef. Look at flow example I've
> > implemented a deleteCommand; when i delete a figure all works, but when
I
> > try to undo the command I get:
> >
> > java.lang.NullPointerException
> >
> > at
> >
>
org.eclipse.gef.editparts.AbstractEditPart.getRoot(AbstractE ditPart.java:580
> > )
> >
> > at
> >
>
org.eclipse.gef.editparts.AbstractEditPart.getViewer(Abstrac tEditPart.java:6
> > 30)
> >
> > at
> >
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.createOr FindConnection(A
> > bstractGraphicalEditPart.java:285)
> >
> > at
> >
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshT argetConnections
> > (AbstractGraphicalEditPart.java:640)
> >
> > at
> >
>
org.eclipse.dylog.editors.graphical.part.ActivityPart.proper tyChange(Activit
> > yPart.java:107)
> >
> > at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
> >
> > at org.eclipse.dylog.model.Activity.firePropertyChange(Activity .java:81)
> >
> > at
org.eclipse.dylog.model.Activity.addTargetConnection(Activit y.java:99)
> >
> > at
> >
>
org.eclipse.dylog.model.command.DeleteCommand.restoreConnect ions(DeleteComma
> > nd.java:88)
> >
> > at
> >
org.eclipse.dylog.model.command.DeleteCommand.undo(DeleteCom mand.java:115)
> >
> > at
org.eclipse.gef.commands.CompoundCommand.undo(CompoundComman d.java:169)
> >
> > at org.eclipse.gef.commands.CommandStack.undo(CommandStack.java :229)
> >
> > ...
> >
> > It seems that the editPart I've added dosn't have a parent!Idon't
> understand
> > how it's possible!
> >
> > Please help me. Thanks
> >
> >
>
>
Previous Topic:Using tool tip for target feedback
Next Topic:GEF with eclipse 3.0 M08
Goto Forum:
  


Current Time: Fri Apr 19 11:49:54 GMT 2024

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

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

Back to the top