|
Re: How to get the EditPart at the mouse location? [message #192998 is a reply to message #192909] |
Wed, 24 August 2005 03:39 |
Eclipse User |
|
|
|
Originally posted by: bashar.infromatik.uni-bonn.de
You may do it with EditPartViewer#findObjectAt(Point location).
But I think it's better to use SelectionAction#getSelectedObjects() instead.
"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:defpuf$vts$1@news.eclipse.org...
> In order to correctly display my context menus, I need to know over which
> EditPart the mouse currently is (I cannot use the selected EditPart).
> Currently I have extended the org.eclipse.gef.tools.SelectionTool in order
> to make one protected method public; this gives me access to the mouse
> location since all relevant methods are not public. Then I set and load
> the default tool on the DefaultEditDomain of my GraphicalEditor to my own
> SelectionTool, so that I can get the EditPart at the current mouse from
> the viewer.
>
> This approach seems work, but I am wondering of there is a better way to
> do this?
>
|
|
|
|
Re: How to get the EditPart at the mouse location? [message #193188 is a reply to message #192909] |
Wed, 24 August 2005 17:00 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> In order to correctly display my context menus, I need to know over which
> EditPart the mouse currently is (I cannot use the selected EditPart).
context menus should be based *only* on selection. You can display a context
menu even if the mouse is outside of the control by pressing SHIFT+F10.
What is your motivation for differing from the platform behavior?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03379 seconds