Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How does one get the current mouse location for a ContexMenuProvider?
How does one get the current mouse location for a ContexMenuProvider? [message #240398] Wed, 02 January 2008 21:19 Go to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
How does one get the current mouse location for a ContexMenuProvider?
Re: How does one get the current mouse location for a ContexMenuProvider? [message #240473 is a reply to message #240398] Mon, 07 January 2008 15:48 Go to previous messageGo to next message
Richard Adams is currently offline Richard AdamsFriend
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Try
Point pos = Display.getCurrent().getCursorLocation();
pos=map.getGraphicalViewer().getControl().toControl(pos) ;

will get a point that you have clicked on in the editor, not sure if this
is what you want.

where 'map' refers to the GEF editor class.
We use this in a PasteAction class that inherits from a GEF
SelectionAction.


Re: How does one get the current mouse location for a ContexMenuProvider? [message #240546 is a reply to message #240473] Wed, 09 January 2008 18:30 Go to previous message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
Works great thanks,drew
"Richard Adams" <richard.adams@ed.ac.uk> wrote in message
news:5cb4a1f2c6d16ae20d93096b5a2cdf1d$1@www.eclipse.org...
> Try Point pos = Display.getCurrent().getCursorLocation();
> pos=map.getGraphicalViewer().getControl().toControl(pos) ;
>
> will get a point that you have clicked on in the editor, not sure if this
> is what you want.
>
> where 'map' refers to the GEF editor class.
> We use this in a PasteAction class that inherits from a GEF
> SelectionAction.
>
>
>
Previous Topic:Tooltip extra large
Next Topic:Accessibility problems on Figure.
Goto Forum:
  


Current Time: Thu Apr 25 12:44:29 GMT 2024

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

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

Back to the top