I wanted to run a bat file in which it can <strong>import preferences</strong> from a location (which was exported manually). I searched for the <strong><em>command which would import preferences</em></strong> but, could not find any.Answer1:
There is no existing code to do this. You would have to write an Eclipse headless application that does something like this:<pre class="lang-java prettyprint-override">
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.
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 <a href="http://blog.vogella.com/2012/08/07/eclipse-papercut-9-default-preference-settings-via-plugin_customization-ini-type-filter-example/" rel="nofollow">this page</a> the author talks about using
-pluginCustomization parameter inside the
-pluginCustomization plugin_customization.ini -startup plugins/org.eclipse....
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).