在 Eclipse“文件比较”中显示标记看法
我通过在比较视图的弹出(上下文)菜单上激活的处理程序向标准 Eclipse“比较视图”添加了一些功能。该处理程序所做的事情之一是在选择位置添加一个标记。但是,比较视图中不显示标记。如何增强比较视图以显示标记?我必须建立自己的观点吗?
I've added some functionality to the standard Eclipse "compare view" via a handler which is activated on the Compare view's popup (context) menu. One of the things that this handler does is add a marker at the selection location. However, markers are not shown in the compare view. How can I enhance the compare view to show markers? Do I have to build my own view?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
比较编辑器与标准编辑器确实不同,每个功能都必须为其重新实现。您必须自己编写代码(据我所知),但您可以查看原始编辑器的实现以获取提示。
在 Eclipse 中,AbstractDecolatedTextEditor 实现标记显示功能(它是 TextEditor 类的后代)。在使用比较编辑器的情况下,此功能难以实现的原因是,比较编辑器一次打开两个资源,因此很难将每个标记放入正确的位置(我认为这就是为什么它没有被普遍实现的原因)。
The compare editor is really different from the standard editors, every functionality has to be reimplemented for it. You have to code it yourself (as far as I know), but you can look at the implementation of the original editor for hints.
In case of Eclipse, AbstractDecoratedTextEditor implements the marker display functionality (that is a descendant of the TextEditor class). What makes this functionality hard to implement in case of Compare editors is the fact, that the compare editor opens two resources at once, so it is harder to put every marker into its correct place (I think that's why it is not implemented generically).