0

I writing an eclipse plugin to analyze files for some defects, I get the list of java files, their classes and methods in a jface tree view, I need to open the file in the editor when I double click on the file node of the tree view.

please help me with this.

thanks,
Shasinda

2 Answers2

0

You should either use a common navigator framework with corresponding filters that already has the link and open function built-in for Eclipse Resources, however, is much trickier to set up - see the blog post series starting with http://cvalcarcel.wordpress.com/2009/07/08/writing-an-eclipse-plug-in-part-1-what-im-going-to-do/

Alternatively, you could add a double click listener that opens an editor (or checks existing editors of the current workbenchpage) by looking the open editors. For the basic idea, see the corresponding Eclipse FAQ entry.

Zoltán Ujhelyi
  • 13,788
  • 2
  • 32
  • 37
0

Use IDE.openEditor to open the editor.

Eugene
  • 9,242
  • 2
  • 30
  • 29