简体   繁体   English

在jface / swt-eclipse插件开发中的treeviewer中单击标签时,如何跳到编辑器中的特定行

[英]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. 我正在做一个eclipse插件项目。 I have realized a view by TreeViewer, which can read info from text and show them. 我已经实现了TreeViewer的视图,该视图可以从文本中读取信息并显示它们。 The treeViewer has several columns and one of which shows the specific line number in a file, treeViewer有几列,其中一列显示文件中的特定行号,

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) java.lang.NoClassDefFoundError:无法在de.toem.eclipse.toolkits.util.SelectionUtils.getElements(SelectionUtils.java:36)处初始化类de.toem.pattern.element.Elements

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. 您可以查看org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink的源代码,这是单击Java堆栈跟踪中的类名称超链接时从控制台视图调用的代码。 This understands how to find the class, open the Java editor and go to the line number. 这了解如何查找类,打开Java编辑器并转到行号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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