How to Import Preferences (.epf) in eclipse via command prompt?

半城伤御伤魂 提交于 2020-01-03 20:49:27

问题


I wanted to run a bat file in which it can import preferences from a location (which was exported manually). I searched for the command which would import preferences but, could not find any.


回答1:


There is no existing code to do this. You would have to write an Eclipse headless application that does something like this:

IPreferencesService service = Platform.getPreferencesService();

IExportedPreferences prefs = service.readPreferences(file input stream);

// TODO create IPreferenceFilter array to filter what you want

service.applyPreferences(prefs, filter array);

See the source of the import preferences page org.eclipse.ui.internal.wizards.preferences.WizardPreferencesImportPage1 for an example.




回答2:


Backstory: I was looking for something similar and, a few tabs back, I've stumbled on a "half-an-answer"/alternative solution. Even if the thread is old might still turn in handy ...

In this page the author talks about using -pluginCustomization parameter inside the eclipse.ini file

-pluginCustomization
plugin_customization.ini
-startup
plugins/org.eclipse....

The plugin_customization.ini file is similar to the *.epf file, same variables minus the /instance/ prefix (maybe because this way they are interpreted/applied at product(eclipse) level and not as per-workspace preferences).



来源:https://stackoverflow.com/questions/22295198/how-to-import-preferences-epf-in-eclipse-via-command-prompt

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