Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » showing a file in an editor
showing a file in an editor [message #291204] Mon, 12 September 2005 08:33 Go to next message
Eclipse UserFriend
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 #291205 is a reply to message #291204] Mon, 12 September 2005 08:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rup.inf.cbs.dk

You can get started by running the plugin wizard and use the template for
creating a multi page editor.
rup
"Marc Ollier" <MOllier04@de.bosch.com> skrev i en meddelelse
news:56f9867d2de313f5f1ee3663f00445c5$1@www.eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Problems integrating DITA-OT1.1 with eclipse.
Next Topic:CVS merge and keyword substitution
Goto Forum:
  


Current Time: Fri Aug 08 04:45:47 EDT 2025

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

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

Back to the top