简体   繁体   中英

Eclipse Plugin - Listener for switch file

I am creating currently an eclipse-plugin that has both an editor and a view, both shell display the same data from an EMF Model... So now my wish is that everytime you change the opened file in the editor, the ViewPart refreshes, too... I have already in the init() function of my editor a call to a method of my view that refresh() its viewer... Problem is just that init() is only called when you open the file. But when you have 2 or more files opened at the same time and you switch between them, init() is not called, so my view doesnt refresh... Anybody a solution for that?

Best regards, Anton

Just override the setFocus() method of your editor. It will be called each time a switch to an opened file occurs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM