Skip to main content



      Home
Home » Eclipse Projects » GEF » Is this me or is this a bug?
Is this me or is this a bug? [message #50818] Mon, 23 December 2002 14:05 Go to next message
Eclipse UserFriend
I'm using build number I20021108

I've got some code based around the logic example that the following code
snippet in an edit policy:

protected Command createDeleteCommand(DeleteRequest request)
{
Object parent = getHost().getParent().getModel();
DeleteCommand deleteCmd = new DeleteCommand();
deleteCmd.setParent((PolicyDiagram) parent);
deleteCmd.setChild((PolicySubpart) getHost().getModel());
return deleteCmd;
}

The problem is intermitent but what appears to be happening is the
following.

I'm changing the EditParts of a diagram, so new edit parts get added and the
old ones are removed, at which point the parent of the old part is set to
null.

This happens in removeChild in GEFs AbstractEditPart.

However, one of the old edit parts had the focus. And when I select a new
edit part a selectionChanged event is fired from AbstractEditPartViewer and
I am passed the old edit part now with a null parent.

Have I done something wrong?
Re: Is this me or is this a bug? [message #50930 is a reply to message #50818] Tue, 24 December 2002 11:35 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

AbstractEditPart.removeNotify() will deselect the EditPart and ensure that
it does not focus. When the old EditPart is deleted, it will get sent
removeNotify() by its parent before the parent is set to null.


"John Howard" <john.howard9@btinternet.com> wrote in message
news:au7maq$gb6$1@rogue.oti.com...
> I'm using build number I20021108
>
> I've got some code based around the logic example that the following code
> snippet in an edit policy:
>
> protected Command createDeleteCommand(DeleteRequest request)
> {
> Object parent = getHost().getParent().getModel();
> DeleteCommand deleteCmd = new DeleteCommand();
> deleteCmd.setParent((PolicyDiagram) parent);
> deleteCmd.setChild((PolicySubpart) getHost().getModel());
> return deleteCmd;
> }
>
> The problem is intermitent but what appears to be happening is the
> following.
>
> I'm changing the EditParts of a diagram, so new edit parts get added and
the
> old ones are removed, at which point the parent of the old part is set to
> null.
>
> This happens in removeChild in GEFs AbstractEditPart.
>
> However, one of the old edit parts had the focus. And when I select a new
> edit part a selectionChanged event is fired from AbstractEditPartViewer
and
> I am passed the old edit part now with a null parent.
>
> Have I done something wrong?
>
>
>
>
>
>
Previous Topic:Change the location of a Figure in a different thread
Next Topic:Connection Anchor question in Logic Editor Example
Goto Forum:
  


Current Time: Fri Apr 25 00:42:53 EDT 2025

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

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

Back to the top