Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to get the Caret point in an editor
How to get the Caret point in an editor [message #212076] Fri, 25 May 2007 10:10 Go to next message
Eclipse UserFriend
Originally posted by: manisha.dinkar.sur.accenture.com

Hi,

Can anybody tell me how to get the point (org.eclipse.swt.graphics.Point)
position of the Caret within the editor.
I want to show a popup menu at the caret position within a editor.

Thanks,
Manisha
Re: How to get the Caret point in an editor [message #212184 is a reply to message #212076] Sat, 26 May 2007 15:16 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Manisha Sur wrote:

> Hi,
>
> Can anybody tell me how to get the point
> (org.eclipse.swt.graphics.Point) position of the Caret within the editor.
> I want to show a popup menu at the caret position within a editor.

I assume "the" editor is your own text editor:
StyledText styledText= getSourceViewer().getTextWidget();
styledText.getLocationAtOffset(caretOffset);

Dani
Previous Topic:Ruby Debugger for Eclipse 3.2 under Ubuntu 7.04
Next Topic:Make SWT/Jface application outside of Eclipse
Goto Forum:
  


Current Time: Thu Apr 25 14:44:45 GMT 2024

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

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

Back to the top