卸载Eclipse插件时如何清除Preference Store中的数据? [英] How to clear data in Preference Store when uninstalling an Eclipse plugin?

查看:259
本文介绍了卸载Eclipse插件时如何清除Preference Store中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个具有自己的偏好页面的Eclipse插件。
我正在使用IPersistentPreferenceStore存储一些数据,但是在卸载我的插件时要删除/清除此数据。否则,每当我重新安装插件时,我都会从以前的安装中重新加载旧数据。



到目前为止,我没有成功找到任何钩子/事件插件卸载通知我的插件。
有没有人有想法?

解决方案

一种方法是你的插件明确地将一个监听器注册到 IProvisioningEventBus 是P2的内部API。



然后,如果有事情要被删除,您的监听器将被通知如果要删除的插件是您想要的首选商店。


I'm developing an Eclipse-Plugin which has it's own preference page. I'm storing some data using IPersistentPreferenceStore, but would like to remove / clear this data upon uninstall of my plugin. Otherwise, whenever I re-install the plugin, I get the old data loaded again from previous installations.

So far I was not successful in finding any hooks / events for eclipse plugin uninstall to notify my plugin. Does anyone have an idea?

解决方案

A way is that your plug-in explicitly registers a listener to IProvisioningEventBus that is an internal API of P2.

Then your listener would be notified if something are about to be removed, clean your preference store if the to be removed plug-in is what you want.

这篇关于卸载Eclipse插件时如何清除Preference Store中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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