Delegation of selection [message #15666] |
Thu, 25 July 2002 07:17  |
Eclipse User |
|
|
|
Originally posted by: entin.togethersoft.com
Hi!
Does anyone know how to make selection of an EditPart result to selection of
the EP parent?
I.e. I have hierarchy of EditParts with SelectionEditPolicy assigned - one
could click on element see selection handles, etc. Now I want to have
functionality when a child is clicked and parent object is selected.
I've tried to install my own SelectionEditPolicy, which returns parent host,
but this didn't have required effect.
If I don't assign the EditPolicy to the child - on clicking the focus really
goes to the child, but selection is not shown neither for child nor for
parent (I need the latter).
Any ideas?
Thanks!
Best regards,
Nick
|
|
|
Re: Delegation of selection [message #15767 is a reply to message #15666] |
Thu, 25 July 2002 09:39  |
Eclipse User |
|
|
|
Originally posted by: none.ibm.com
"News Togethersoft CZ" <entin@togethersoft.com> wrote in message
news:ahokp5$ff7$1@rogue.oti.com...
> Hi!
>
> Does anyone know how to make selection of an EditPart result to selection
of
> the EP parent?
In theory, you are supposed to be able to say that your EditPart is not the
target of "selection", which the SelectionTool will ask before selecting the
part. If it is not the target, and its parent is, then you will see the
parent selected. Or course the parent will only appear selected if it shows
handles or changes its visuals somehow.
However, this doesn't work with the Marquee tool yet because it doesn't ask
if an editpart is "selectable". What are you trying to do? Should both the
child and parent be selected together? Or is the EditPart *never*
selectable? If never, you could override registerVisuals() to do nothing.
As a side-effect, NO tools would ever be able to hit that editpart, because
the figure is not mapped back to the part. This is rarely useful though.
I believe what is required in GEF is to add:
EditPart.isSelectable(); //returns boolean
This is much more straightforward than sending a request, and selection is a
very fundamental property, which merits its own API to query it. Besides
the SelectionTool and MarqueeTool, KeyboardHandlers will also need to query
this property for selection traversal. If this would be most useful to you,
please open a Bugzilla so you can track when this change is released.
>
> I.e. I have hierarchy of EditParts with SelectionEditPolicy assigned - one
> could click on element see selection handles, etc. Now I want to have
> functionality when a child is clicked and parent object is selected.
> I've tried to install my own SelectionEditPolicy, which returns parent
host,
> but this didn't have required effect.
> If I don't assign the EditPolicy to the child - on clicking the focus
really
> goes to the child, but selection is not shown neither for child nor for
> parent (I need the latter).
>
> Any ideas?
>
> Thanks!
>
> Best regards,
> Nick
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05696 seconds