重命名资源文件不会更改编辑器的部分标题 [英] Rename resource file does not change editor part title

查看:391
本文介绍了重命名资源文件不会更改编辑器的部分标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的插件项目中,我有一个项目浏览器视图,我可以重命名一个配置文件,在另一个编辑器部分显示。该文件可以在资源管理器中使用重命名资源对话框重命名,但对应的编辑器选项卡标题不会更改。 here 以及这里。有没有创建自定义侦听器来获得重命名功能的标准方法?

解决方案

编辑基于 AbstractTextEditor (或其子类之一,例如 TextEditor )应该通过 FileDocumentProvider 它监听资源更改。



其他编辑者需要使用 IResourceChangeListener 来处理这个。 p>

In my plugin project, I have a project explorer view where I can rename a config file which in shown in another editor part. The file can be renamed in the explorer with the rename resource dialog but the corresponding the editor tab title does not change. The same problem is described here and also here. Is there a standard way to get the rename functionality working without the creating a custom listener?

解决方案

Editors based on AbstractTextEditor (or one of its subclasses such as TextEditor) should handle renames through the FileDocumentProvider which listens for resource changes.

Other editors need to use an IResourceChangeListener to deal with this.

这篇关于重命名资源文件不会更改编辑器的部分标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆