Eclipse插件:对视图的关闭做出反应? [英] Eclipse plugin: react on closure of view?

查看:254
本文介绍了Eclipse插件:对视图的关闭做出反应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Eclipse Pluging视图,扩展了ViewPart(如果这意味着什么)。当我的视图关闭或者eclipse被完全关闭以执行一些最后的操作时,我想被通知。



如何获取关闭我的视图的通知?

解决方案

p>使用 IPartService.addPartListener(IPartListener)



编辑:关闭会话(Eclipse关闭时) org.eclipse.ui.part.ViewPart.saveState(IMemento)将被调用以允许您保存可恢复的状态在你的下一次激活。但如果用户关闭了零件,则不会被调用。


I have an Eclipse pluging view that extends ViewPart (if that means something). I want to be notified when my view is closed or eclipse is closed entirely to perform some final operations.

How can I get a notification of my view being closed?

解决方案

Use IPartService.addPartListener(IPartListener).

EDIT: Also, for session close (when Eclipse is shut down) org.eclipse.ui.part.ViewPart.saveState(IMemento) will be called to allow you to save state that can be restored on your next activation. But it will not be called if the user closes the part.

这篇关于Eclipse插件:对视图的关闭做出反应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆