简体   繁体   中英

how can i jump to a specific line in an editor when click a label in the treeviewer in jface/swt-eclipse plugin development

I'm doing an eclipse plugin project. I have realized a view by TreeViewer, which can read info from text and show them. The treeViewer has several columns and one of which shows the specific line number in a file,

just like this:

java.lang.NoClassDefFoundError: Could not initialize class de.toem.pattern.element.Elements at de.toem.eclipse.toolkits.util.SelectionUtils.getElements(SelectionUtils.java:36)

I have no idea how to jump to the file when click the number, please help me..

You could look at the source of org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink which is the code called from the Console view when you click on a class name hyperlink in a Java stack trace. This understands how to find the class, open the Java editor and go to the line number.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM