How to change title in editor tab?

I need to change editor tab title in my FileEditorManagerListener implementation when file is opened. I found EditorTabbedContainer that can change label of tabs, but I doesn't found way to obtain it. Object of this class is private member in EditorWindow and has no get/set methods. Is there another way to change title in tabs?

Thanks.

2 comments
Comment actions Permalink

use extension point com.intellij.editorTabTitleProvider (find example in maven plugin in community sources)

0
Comment actions Permalink

Thank you very much!
How could I miss this code in EditorTabbedContainer:

public static String calcTabTitle(final Project project, final VirtualFile file) {
    for (EditorTabTitleProvider provider : Extensions.getExtensions(EditorTabTitleProvider.EP_NAME)) {
      final String result = provider.getEditorTabTitle(project, file);
      if (result != null) {
        return result;
      }
    }

    return file.getPresentableName();
  }

0

Please sign in to leave a comment.