showing a file in an editor [message #291204] |
Mon, 12 September 2005 08:33  |
Eclipse User |
|
|
|
Hi,
I am trying to build a browser and need to show a particular file in an
editor (currently the C Editor from the CDT) when I double-click on an
item in my browser.
My problem is that I do not know how to get the instance of the editor.
Could you help me?
After that, I would like to open/show a file in that editor and jump to a
particular line number.
Thanks
Marc
|
|
|
|
Re: showing a file in an editor [message #291212 is a reply to message #291204] |
Mon, 12 September 2005 09:15  |
Eclipse User |
|
|
|
Marc Ollier wrote:
> Hi,
>
> I am trying to build a browser and need to show a particular file in an
> editor (currently the C Editor from the CDT) when I double-click on an
> item in my browser.
>
> My problem is that I do not know how to get the instance of the editor.
> Could you help me?
> After that, I would like to open/show a file in that editor and jump to
> a particular line number.
To get an already open editor, you can use the methods in IWorkbenchPage
.... getEditorReferences() to look through all of the open editors,
findEditor(IEditorInput) to find an editor that's already open on a file.
To open an editor, you can use IWorkbenchPage#openEditor(...). It takes
your input, and the id of the editor which you can find from the plugin
it came from.
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.04013 seconds