|
|
Re: How to move child editparts correctly? [message #193013 is a reply to message #192866] |
Wed, 24 August 2005 04:01 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
The parent's ContainerEditPolicy or LayoutEditPolicy should handle this in
getOrphanChildrenCommand().
"Andreas Holtz" <A.Holtz@gmx.net> wrote in message
news:deesvq$llc$1@news.eclipse.org...
> Hi,
>
> I have a question for moving elements.
> I have an Editpart A with possible children B and C.
> I want that child B can be moved to different editparts A (uses the
createAddCommand of the layoutPolicy of target A).
> What I want is to prevent the move of C to an different editpart A.
> I could realize this by testing on instances of the moved child and return
null. But with bigger models this could be very complex.
>
> My question:
> How is the deletion of the child in the source editpart correctly handled
(perhaps with invocation of getDeleteDependantCommand(Request)?)
>
> Currently I delete the child before adding it to the target editpart. But
I think the layoutPolicy of the source should handle this.
>
> Thanks in advance
>
> Andreas
|
|
|
|
|
Re: How to move child editparts correctly? [message #193382 is a reply to message #193332] |
Thu, 25 August 2005 22:23 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
> With the getOrphanChildrenCommand() I can delete the child correctly, but
I can not prevent the movement of the child.
The target editpart's getAddCommand() should handle that. Essentially, when
reparenting a part, you're first asking the old parent if that child can be
removed from it and then asking the new one if that child can be added to
it. If either one returns null or unexecutable command, that child will not
be moved.
|
|
|
|
Re: How to move child editparts correctly? [message #193536 is a reply to message #193382] |
Fri, 26 August 2005 13:46 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> The target editpart's getAddCommand() should handle that. Essentially,
> when
> reparenting a part, you're first asking the old parent if that child can
> be
> removed from it and then asking the new one if that child can be added to
> it. If either one returns null or unexecutable command, that child will
> not
> be moved.
null indicates a no-op, meaning the orphan might be free when the add is
executed. I think it is necessary to return an unexecutable command.
|
|
|
Re: How to move child editparts correctly? [message #193553 is a reply to message #193491] |
Fri, 26 August 2005 14:20 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
"Andreas Holtz" <A.Holtz@gmx.net> wrote in message
news:demvsd$s04$1@news.eclipse.org...
> Pratik Shah schrieb am 26.08.2005 00:23:
> >>With the getOrphanChildrenCommand() I can delete the child correctly,
but
> >
> > I can not prevent the movement of the child.
> >
> > The target editpart's getAddCommand() should handle that. Essentially,
when
> > reparenting a part, you're first asking the old parent if that child can
be
> > removed from it and then asking the new one if that child can be added
to
> > it. If either one returns null or unexecutable command, that child will
not
> > be moved.
> >
> >
>
> And that's the problem:
> How do I ask the old parent if that child can be deleted?
> Asking the new one ist the result of createAddCommand, I think.
Okay, now we're going in circles...getOrphanChildrenCommand() should return
an unexecutable command if the child can't be removed from the old parent.
Maybe you should shed some light on the problem you're running into.
>
> Thanx
>
> Andreas
|
|
|
|
Powered by
FUDForum. Page generated in 0.11037 seconds