How do I get notified whenever a new editor is opened in Eclipse?

后端 未结 2 1949
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 12:42

I have a view which would like to be notified about all the currently opened editors. Where can I add a listener to achieve this?

I was expecting WorkbenchPage or Editor

2条回答
  •  野的像风
    2021-02-06 13:12

    I think you're on the right track. You need to listen to the IWorkbenchPage IPartService events:

    page.addPartListener(new IPartListener() {
        partOpened(IWorkbenchPart part) {
            ...
        }
    
        ...
    });
    

提交回复
热议问题