Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Opening a Java File given a filename and line number
Opening a Java File given a filename and line number [message #89356] Fri, 04 July 2003 19:01 Go to next message
Eclipse UserFriend
Originally posted by: andy.slamjibe.com

I am in the process of writing my own plugin view which needs to be able
to open java source files in the editor and select a given line. I have
the filename and the line number available to me and would like to know
how turn these into the action I require.

Can anyone offer help / starting point - thanks

Andy
Re: Opening a Java File given a filename and line number [message #91364 is a reply to message #89356] Thu, 10 July 2003 18:40 Go to previous message
Eclipse UserFriend
Originally posted by: John_Arthorne.oti.com_

One way to do this is to create a text marker in the file with the
appropriate offset and length, and then use

IWorkbenchPage.openEditor(IMarker) or
IEditorPart.gotoMarker(IMarker)

You can delete the marker after opening using IMarker.delete.
There is a utility class for creating text markers called
MarkerUtilities in org.eclipse.ui.texteditor.
--


Andrew Sadler wrote:
> I am in the process of writing my own plugin view which needs to be able
> to open java source files in the editor and select a given line. I have
> the filename and the line number available to me and would like to know
> how turn these into the action I require.
>
> Can anyone offer help / starting point - thanks
>
> Andy
>
Previous Topic:ClassCastException in VariableContextManager
Next Topic:Error while closing workbench
Goto Forum:
  


Current Time: Tue Jul 08 15:00:38 EDT 2025

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

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

Back to the top