Import Preferences [message #603815] |
Wed, 16 December 2009 23:12  |
Eclipse User |
|
|
|
Hello,
I have a plugin that implements IStartup, and I would like to import some standard preferences on eclipse start.
Here is the code I'm using based on examples from org.eclipse.core.runtime.Preferences :
public final void importDefaultPrefs(String path) {
IPreferencesService prefService = org.eclipse.core.runtime.Platform
.getPreferencesService();
//IPreferencesService prefService = org.eclipse.core.internal.preferences.PreferencesService
// .getDefault();
try {
//Preferences.importPreferences(new Path(path));
prefService.importPreferences(new FileInputStream(new File(path)));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (CoreException e) {
e.printStackTrace();
}
}
But on Eclipse startup I get this error :
Error notifying a preference change listener. Check the log for details.Invalid thread access.
Any idea what I have done wrong or overlooked?
Regards, Cosmin
|
|
|
|
Powered by
FUDForum. Page generated in 0.04995 seconds