Openning source file in editor programmatically [message #157272] |
Sat, 17 June 2006 19:08  |
Eclipse User |
|
|
|
Originally posted by: sbederml.gmail.com
Hi,
I have a source file. How can I open it in the java editor *on a
specific line*. The problem is that JavaUI.openInEditor() method does
not give me the option to set the wanted line.
Thank you in advance,
Michael
|
|
|
Re: Openning source file in editor programmatically [message #157341 is a reply to message #157272] |
Mon, 19 June 2006 10:12  |
Eclipse User |
|
|
|
Michael Beder wrote:
> Hi,
>
> I have a source file. How can I open it in the java editor *on a
> specific line*. The problem is that JavaUI.openInEditor() method does
> not give me the option to set the wanted line.
You first open the editor and then check whether the editor you get is
an ITextEditor. If so, you an use its API to compute the offset and
length of your line and then select and reveal it. Look at
GotoLineAction if you don't know how to code it.
Dani
>
> Thank you in advance,
> Michael
|
|
|
Powered by
FUDForum. Page generated in 0.05260 seconds