为什么关闭编辑器时不调用 IPerspectiveListener.perspectiveChanged()?

Why IPerspectiveListener.perspectiveChanged() isn't called when an editor is closed?

如果我打开一个编辑器,IPerspectiveListener.perspectiveChanged() 将被调用,但如果我关闭一个编辑器,它就不会被调用。为什么?

我认为必须使用 IWorkbenchPage.CHANGE_EDITOR_CLOSE 作为 changeId 参数的值来调用它。

这看起来像是 Eclipse 错误 392963,它已经公开了一段时间,但看起来没有得到解决。

另一种方法是使用 IPartListener(或 IPartListener2),它还会告诉您有关部件打开和关闭的信息。