Eclipse API: Simulate console linking functionality

66 Views Asked by At

When "filename:line" is displayed in the console, it becomes a link to the appropriate place in the code. I'm trying to duplicate this functionality in an Eclipse plugin and not having much.

I got a bit of help from these sites:
eclipse plugin: How to programmatically select text in editor?
Eclipe PDE: Jump to line X and highlight it
http://www.eclipse-tips.com/tips/9-open-editor-programmatically

But they've all gone a bit over my head (as I rather new to Java and Eclipse). They seem unnecessarily complex for my simple problem. I found another person asking almost the same question at http://www.eclipse.org/forums/index.php/t/560031/, but no one was able to help them.

So, given a file name (such as MyClass.java) and a line number, how do I tell Eclipse to open the file and show the line? If someone could just point me to the place in the Eclipse source that does the same thing, I'm sure that would go a long way towards the solution.

0

There are 0 best solutions below