Skip to main content



      Home
Home » Eclipse Projects » GEF » Delegation of selection
Delegation of selection [message #15666] Thu, 25 July 2002 07:17 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
>
>
Previous Topic:a question on drag and drop a text from Word editor to Graphical Editor
Next Topic:TextTransferDropTargetListener : what's its usage
Goto Forum:
  


Current Time: Thu Jul 10 07:41:19 EDT 2025

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

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

Back to the top