How to clear data in Preference Store when uninstalling an Eclipse plugin?

耗尽温柔 提交于 2019-12-24 07:13:03

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/7269505/how-to-clear-data-in-preference-store-when-uninstalling-an-eclipse-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!