Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Import Preferences
Import Preferences [message #603815] Wed, 16 December 2009 23:12 Go to next message
Eclipse UserFriend
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
Re: Import Preferences [message #603819 is a reply to message #603815] Thu, 17 December 2009 08:45 Go to previous message
Eclipse UserFriend
On 17/12/09 9:42 AM, Cosmin wrote:
> 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?

Probably one of the listener is trying to access the UI when fired. Do
you have any stack traces?

--
- Prakash
Platform UI Team, IBM

Blog <http://blog.eclipse-tips.com>
Twitter <http://www.twitter.com/Eclipse_Tips>
Previous Topic:Import Preferences
Next Topic:Trouble with headless build since Eclipse 3.5
Goto Forum:
  


Current Time: Wed Jul 16 02:35:59 EDT 2025

Powered by FUDForum. Page generated in 0.04995 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top