Getting Line number and offset from a IProblemLocation [message #724317] |
Mon, 12 September 2011 04:46  |
Eclipse User |
|
|
|
Hi all,
I am aware that there is getOffset() method for IProblemLocation class. Is there a way to easily transfer this to line number (in the file) and offset on that line?
For example:
location.getOffset() returns 77
I want to get the following:
location.getLineNumber() (this does not exist) = 5
location.getLineOffset() (this also does not exist) = 15
Also, is there a way to retrieve the related file name (i.e., something.java) using IProblemLocation?
Thanks, best regards,
|
|
|
Re: Getting Line number and offset from a IProblemLocation [message #724958 is a reply to message #724317] |
Tue, 13 September 2011 14:58  |
Eclipse User |
|
|
|
On 12.09.2011 06:46, Kivanc Muslu wrote:
> Hi all,
> I am aware that there is getOffset() method for IProblemLocation
> class. Is there a way to easily transfer this to line number (in the
> file) and offset on that line?
If you have the file or document, then you can use the
org.eclipse.jface.text.IDocument API.
>
> For example:
> location.getOffset() returns 77
> I want to get the following:
> location.getLineNumber() (this does not exist) = 5
> location.getLineOffset() (this also does not exist) = 15
>
> Also, is there a way to retrieve the related file name (i.e.,
> something.java) using IProblemLocation?
No.
Dani
>
> Thanks, best regards,
|
|
|
Powered by
FUDForum. Page generated in 0.02819 seconds