Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » get line no and col no of the clicked position
get line no and col no of the clicked position [message #181273] Wed, 22 November 2006 13:31 Go to next message
Eclipse UserFriend
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 #181339 is a reply to message #181273] Wed, 22 November 2006 16:50 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
sp wrote:

> 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.

Is this a text editor (i.e. subclass of AbstractTextEditor)?

Dani

> Thanks in advance
>
> SP
>
Re: get line no and col no of the clicked position [message #181418 is a reply to message #181339] Thu, 23 November 2006 05:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rsriprabha.gmail.com

yes it is a text editor
Re: get line no and col no of the clicked position [message #181443 is a reply to message #181418] Thu, 23 November 2006 08:55 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
sp wrote:

> yes it is a text editor

Take a look at AbstractTextEditor.getCursorPosition()

HTH
Dani
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Same version but ....
Next Topic:Newbie - How to delete console configuration
Goto Forum:
  


Current Time: Sat Apr 20 05:19:50 GMT 2024

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

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

Back to the top