get line no and col no of the clicked position [message #181273] |
Wed, 22 November 2006 13:31 |
Eclipse User |
|
|
|
Originally posted by: rsriprabha.gmail.com
hi
when we right click on an editor and click on a context menu,how do we
get the line number and column number of the position we are clicking.This
information has to be displayed in a custom view.Could anybody help me out
on this.
Thanks in advance
SP
|
|
|
|
|
|
Re: get line no and col no of the clicked position [message #181490 is a reply to message #181418] |
Fri, 24 November 2006 02:19 |
Eclipse User |
|
|
|
Originally posted by: wayne.beaton._NOSPAM_eclipse.org
sp wrote:
> yes it is a text editor
>
Check out AbstractTextEditor#getSelectionProvider(). Ask the selection
provider for it's selection which should be a instance of ITextSelection
(it could be other things, so check). Interrogate that instance for the
information you need. You'll find lots of useful methods on ITextSelection.
HTH,
Wayne
|
|
|
Powered by
FUDForum. Page generated in 0.09580 seconds