Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » REQ_DELETE_DEPENDANT
REQ_DELETE_DEPENDANT [message #189934] Mon, 01 August 2005 11:23 Go to next message
Eclipse UserFriend
Originally posted by: sidney.lee.ibs.net

Hi!

Didn't get a response to this
news://news.eclipse.org:119/42E10BE8.9070103@ibs.net so I thought I
would repost it here:

I would like to adjust the constraints of siblings after a component has
been resized or deleted. For *resize*, I have implemented
getResizeChildrenCommand(ChangeBoundsRequest) in my XYLayoutEditPolicy -
which works perfectly. Now I would like to do the same for *delete*
using getDeleteDependantCommand(Request) since, according to the
documentation for ConstrainedLayoutEditPolicy and REQ_DELETE_DEPENDANT,
"complex layouts may decide to adjust the constraints of the remaining
children". My problem is that I can't seem to get a REQ_DELETE_DEPENDANT
when I delete a component and seem only to be able to delete anything if
I have a ComponetEdiPolicy implement createDeleteCommand and have it
installed for the COMPONENT_ROLE.

Any suggestion?

Many Thanks (as always)!
Re: REQ_DELETE_DEPENDANT [message #190429 is a reply to message #189934] Wed, 03 August 2005 18:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

When the child editpart gets the delete request, convert it to a delete
dependent request and forward it to the parent editpart.

"Sidney Lee" <sidney.lee@ibs.net> wrote in message
news:dcl0kn$eif$1@news.eclipse.org...
> Hi!
>
> Didn't get a response to this
> news://news.eclipse.org:119/42E10BE8.9070103@ibs.net so I thought I
> would repost it here:
>
> I would like to adjust the constraints of siblings after a component has
> been resized or deleted. For *resize*, I have implemented
> getResizeChildrenCommand(ChangeBoundsRequest) in my XYLayoutEditPolicy -
> which works perfectly. Now I would like to do the same for *delete*
> using getDeleteDependantCommand(Request) since, according to the
> documentation for ConstrainedLayoutEditPolicy and REQ_DELETE_DEPENDANT,
> "complex layouts may decide to adjust the constraints of the remaining
> children". My problem is that I can't seem to get a REQ_DELETE_DEPENDANT
> when I delete a component and seem only to be able to delete anything if
> I have a ComponetEdiPolicy implement createDeleteCommand and have it
> installed for the COMPONENT_ROLE.
>
> Any suggestion?
>
> Many Thanks (as always)!
Re: REQ_DELETE_DEPENDANT [message #190505 is a reply to message #190429] Thu, 04 August 2005 09:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sidney.lee.ibs.net

Hi Pratik!

When u say 'the child editpart gets the delete request convert it
[there]', where exactly would that be - when getCommand() is called on
the child editpart or? And how do I forward it to the parent? (Have a
similar problem where the result from a call to the XYLayoutEditPolicy
method showLayoutTargetFeedback() would also determine whether I need to
forward a REQ_ADD to the parent...)

Thanks, again! Always appreciative.

Pratik Shah wrote:
> When the child editpart gets the delete request, convert it to a delete
> dependent request and forward it to the parent editpart.
>
> "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> news:dcl0kn$eif$1@news.eclipse.org...
>
>>Hi!
>>
>>Didn't get a response to this
>>news://news.eclipse.org:119/42E10BE8.9070103@ibs.net so I thought I
>>would repost it here:
>>
>>I would like to adjust the constraints of siblings after a component has
>>been resized or deleted. For *resize*, I have implemented
>>getResizeChildrenCommand(ChangeBoundsRequest) in my XYLayoutEditPolicy -
>>which works perfectly. Now I would like to do the same for *delete*
>>using getDeleteDependantCommand(Request) since, according to the
>>documentation for ConstrainedLayoutEditPolicy and REQ_DELETE_DEPENDANT,
>>"complex layouts may decide to adjust the constraints of the remaining
>>children". My problem is that I can't seem to get a REQ_DELETE_DEPENDANT
>>when I delete a component and seem only to be able to delete anything if
>>I have a ComponetEdiPolicy implement createDeleteCommand and have it
>>installed for the COMPONENT_ROLE.
>>
>>Any suggestion?
>>
>>Many Thanks (as always)!
>
>
>
Re: REQ_DELETE_DEPENDANT [message #190625 is a reply to message #190505] Fri, 05 August 2005 05:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

You can do it in either EditPart#getCommand() or your EditPolicy, whatever
you deem best. I think the former would be the way to go. As for
converting the request, you should be able to just change its type to
REQ_DELETE_DEPENDANT. If not, then just create a new request as expected
and copy the necessary info from the original request. To forward to
parent:

return getParent().getCommand(newRequest);
OR
return getHost().getParent().getCommand(newRequest());

"Sidney Lee" <sidney.lee@ibs.net> wrote in message
news:42F1E661.7060505@ibs.net...
> Hi Pratik!
>
> When u say 'the child editpart gets the delete request convert it
> [there]', where exactly would that be - when getCommand() is called on
> the child editpart or? And how do I forward it to the parent? (Have a
> similar problem where the result from a call to the XYLayoutEditPolicy
> method showLayoutTargetFeedback() would also determine whether I need to
> forward a REQ_ADD to the parent...)
>
> Thanks, again! Always appreciative.
>
> Pratik Shah wrote:
> > When the child editpart gets the delete request, convert it to a delete
> > dependent request and forward it to the parent editpart.
> >
> > "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> > news:dcl0kn$eif$1@news.eclipse.org...
> >
> >>Hi!
> >>
> >>Didn't get a response to this
> >>news://news.eclipse.org:119/42E10BE8.9070103@ibs.net so I thought I
> >>would repost it here:
> >>
> >>I would like to adjust the constraints of siblings after a component has
> >>been resized or deleted. For *resize*, I have implemented
> >>getResizeChildrenCommand(ChangeBoundsRequest) in my XYLayoutEditPolicy -
> >>which works perfectly. Now I would like to do the same for *delete*
> >>using getDeleteDependantCommand(Request) since, according to the
> >>documentation for ConstrainedLayoutEditPolicy and REQ_DELETE_DEPENDANT,
> >>"complex layouts may decide to adjust the constraints of the remaining
> >>children". My problem is that I can't seem to get a REQ_DELETE_DEPENDANT
> >>when I delete a component and seem only to be able to delete anything if
> >>I have a ComponetEdiPolicy implement createDeleteCommand and have it
> >>installed for the COMPONENT_ROLE.
> >>
> >>Any suggestion?
> >>
> >>Many Thanks (as always)!
> >
> >
> >
Re: REQ_DELETE_DEPENDANT [message #190632 is a reply to message #190625] Fri, 05 August 2005 08:46 Go to previous message
Eclipse UserFriend
Originally posted by: sidney.lee.ibs.net

Thanks, Pratik! Actually, just looked at what was done in the
org.eclipse.gef.editpolicies.ComponentEditPolicy and the
getOrphanCommand() and applied the same approach to the
getDeleteCommand() in my ComponentEditPolicy subclass.

Pratik Shah wrote:
> You can do it in either EditPart#getCommand() or your EditPolicy, whatever
> you deem best. I think the former would be the way to go. As for
> converting the request, you should be able to just change its type to
> REQ_DELETE_DEPENDANT. If not, then just create a new request as expected
> and copy the necessary info from the original request. To forward to
> parent:
>
> return getParent().getCommand(newRequest);
> OR
> return getHost().getParent().getCommand(newRequest());
>
> "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> news:42F1E661.7060505@ibs.net...
>
>>Hi Pratik!
>>
>>When u say 'the child editpart gets the delete request convert it
>>[there]', where exactly would that be - when getCommand() is called on
>>the child editpart or? And how do I forward it to the parent? (Have a
>>similar problem where the result from a call to the XYLayoutEditPolicy
>>method showLayoutTargetFeedback() would also determine whether I need to
>>forward a REQ_ADD to the parent...)
>>
>>Thanks, again! Always appreciative.
>>
>>Pratik Shah wrote:
>>
>>>When the child editpart gets the delete request, convert it to a delete
>>>dependent request and forward it to the parent editpart.
>>>
>>>"Sidney Lee" <sidney.lee@ibs.net> wrote in message
>>>news:dcl0kn$eif$1@news.eclipse.org...
>>>
>>>
>>>>Hi!
>>>>
>>>>Didn't get a response to this
>>>>news://news.eclipse.org:119/42E10BE8.9070103@ibs.net so I thought I
>>>>would repost it here:
>>>>
>>>>I would like to adjust the constraints of siblings after a component has
>>>>been resized or deleted. For *resize*, I have implemented
>>>>getResizeChildrenCommand(ChangeBoundsRequest) in my XYLayoutEditPolicy -
>>>>which works perfectly. Now I would like to do the same for *delete*
>>>>using getDeleteDependantCommand(Request) since, according to the
>>>>documentation for ConstrainedLayoutEditPolicy and REQ_DELETE_DEPENDANT,
>>>>"complex layouts may decide to adjust the constraints of the remaining
>>>>children". My problem is that I can't seem to get a REQ_DELETE_DEPENDANT
>>>>when I delete a component and seem only to be able to delete anything if
>>>>I have a ComponetEdiPolicy implement createDeleteCommand and have it
>>>>installed for the COMPONENT_ROLE.
>>>>
>>>>Any suggestion?
>>>>
>>>>Many Thanks (as always)!
>>>
>>>
>>>
>
>
Previous Topic:Problem with command line update manager
Next Topic:How to use "ToggleSnapToGeometryAction"
Goto Forum:
  


Current Time: Tue Dec 03 06:32:15 GMT 2024

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

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

Back to the top