问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/30167290/rename-resource-file-does-not-change-editor-part-title